アプリケーションに問題があります。Android フォンの gps 位置を取得しています。座標を取得した後、そのデータを Web サービスに渡したいのですが、ローカルホストで問題なく実行されているこのエラーが発生しています。
これらは私が得ているエラーです:
**
03-15 18:43:45.856: E/WindowManager(1906): Activity com.example.projectthesis.LocationPassing has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@412dd820 that was originally added here
03-15 18:43:45.856: E/WindowManager(1906): android.view.WindowLeaked: Activity com.example.projectthesis.LocationPassing has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@412dd820 that was originally added here
03-15 18:43:45.856: E/WindowManager(1906): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:344)
03-15 18:43:45.856: E/WindowManager(1906): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:267)
03-15 18:43:45.856: E/WindowManager(1906): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:215)
03-15 18:43:45.856: E/WindowManager(1906): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:140)
03-15 18:43:45.856: E/WindowManager(1906): at android.view.Window$LocalWindowManager.addView(Window.java:537)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.Dialog.show(Dialog.java:278)
03-15 18:43:45.856: E/WindowManager(1906): at com.example.projectthesis.LocationPassing$phpconnect.onPreExecute(LocationPassing.java:74)
03-15 18:43:45.856: E/WindowManager(1906): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:561)
03-15 18:43:45.856: E/WindowManager(1906): at android.os.AsyncTask.execute(AsyncTask.java:511)
03-15 18:43:45.856: E/WindowManager(1906): at com.example.projectthesis.LocationPassing.onCreate(LocationPassing.java:58)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.Activity.performCreate(Activity.java:4465)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-15 18:43:45.856: E/WindowManager(1906): at android.os.Handler.dispatchMessage(Handler.java:99)
03-15 18:43:45.856: E/WindowManager(1906): at android.os.Looper.loop(Looper.java:137)
03-15 18:43:45.856: E/WindowManager(1906): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-15 18:43:45.856: E/WindowManager(1906): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 18:43:45.856: E/WindowManager(1906): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 18:43:45.856: E/WindowManager(1906): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-15 18:43:45.856: E/WindowManager(1906): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-15 18:43:45.856: E/WindowManager(1906): at dalvik.system.NativeStart.main(Native Method)
**
これは私のクラスです:
**
public class LocationPassing extends Activity{
TextView txtLatitude;
TextView txtLongitude;
public static String strLat;
public static String strLong;
// ** This declarations was for passing of data to web service
// Progress Dialog
private ProgressDialog pDialog;
// JSONParser Object creation
JSONParser jsonParser = new JSONParser();
// url to pass location to web
private static String url_create_product = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx/location_adding.php";
//private static String url_create_product = "http://10.0.2.2/TheCalling/location_adding.php";
// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_PID = "pid";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.locationpassing);
txtLatitude = (TextView) findViewById(R.id.txtLatitude);
txtLongitude = (TextView) findViewById(R.id.txtLongitude);
strLat = Double.toString(Mapping2.ILatitude);
strLong = Double.toString(Mapping2.ILongitude);
this.txtLatitude.setText(strLat);
this.txtLongitude.setText(strLong);
new phpconnect().execute();
}
class phpconnect extends AsyncTask<String, String, String> {
/**
* Before starting background thread Show Progress Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(LocationPassing.this);
pDialog.setMessage("Logging in..");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
@Override
protected String doInBackground(String... args) {
String strLatitude = strLat;
String strLongitude = strLong;
String.valueOf(strLatitude);
String.valueOf(strLongitude);
// Building parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("latitude", strLatitude));
params.add(new BasicNameValuePair("longitude", strLongitude));
// getting JSON Object
// Note that create product url accepts POST method
JSONObject json = jsonParser.makeHttpRequest(url_create_product,
"POST", params);
// check log cat fro response
Log.d("Create Response", json.toString());
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
// successfully updated
Intent i = new Intent(getApplicationContext(),
Mapping2.class);
startActivity(i);
// closing this screen
finish();
} else {
// failed to create product
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
}
}
**
よろしくお願いします。