クラスをdouble
使用して2つの値を取得したいのですが、この間にどのようにすればよいかを示す必要があります.誰かがこれを行うのを手伝ってください.asynctask
progress-dialog
ここに私のコードがあります
public class MyAsyncTask extends AsyncTask<double, int, double>{
private Activity activity;
private ProgressDialog progressDialog;
private double lon;
private double lat;
public MyAsyncTask(Activity activity, double longitude, double latitute) {
super();
this.activity = activity;
this.lon = longitude;
this.lat = latitute;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = ProgressDialog.show(activity, "Loading", "Loading", true);
}
protected double doInBackground(double... v) {
//do your stuff here
if(lat==0.0&&lon==0.0)
return null;
}
@Override
protected void onPostExecute(Result result) {
progressDialog.dismiss();
MyAsyncTask task = new MyAsyncTask(MainActivity.this, gps.getLatitude(), gps.getLongitude());
task.execute();
Toast.makeText(activity.getApplicationContext(), "Finished.",
Toast.LENGTH_LONG).show();
}
}