AsyncTask を使用してデータを収集し、新しいアクティビティを開始していますが、ウィンドウがリークしています。
class GetDataTask extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute()
{
mProgressDialog = new ProgressDialog(getActivity());
mProgressDialog.setMessage("Getting schedule for "+selectedSport+"...");
mProgressDialog.setCancelable(false);
mProgressDialog.show();
}
@Override
protected Void doInBackground(Void... params)
{
XmlPullFeedParser xpfp = new XmlPullFeedParser(scheduleURLtoGet);
ArrayList<Event> allEvents = xpfp.getEvents();
scheduleToPassAlong = allEvents.toArray(new Event[allEvents.size()]);
return null;
}
@Override
protected void onPostExecute(Void res)
{
mProgressDialog.dismiss();
startScheduleActivity();
}
}
private void startScheduleActivity(){
Intent intent = new Intent(this, ScheduleBoard.class);
intent.putExtra(SPORT_NAME_EXTRA, selectedSport);
intent.putExtra(SCHEDULE_FOR_SPORT_EXTRA, scheduleToPassAlong);
startActivity(intent);
}
ScheduleBoard アクティビティで例外が発生しているようですが、doInBackground 内のプロセスが完了していません。
これがスタックです。何が起こっているのかまだわかりません。doInBackground に try/catch がありますが、何もトリガーされません。
07-31 19:48:18.667: E/WindowManager(2866): Activity com.myproj.activities.ScheduleBoard has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40557718 that was originally added here
07-31 19:48:18.667: E/WindowManager(2866): android.view.WindowLeaked: Activity com.myproj.activities.ScheduleBoard has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40557718 that was originally added here
07-31 19:48:18.667: E/WindowManager(2866): at android.view.ViewRoot.<init>(ViewRoot.java:263)
07-31 19:48:18.667: E/WindowManager(2866): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:171)
07-31 19:48:18.667: E/WindowManager(2866): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:114)
07-31 19:48:18.667: E/WindowManager(2866): at android.view.Window$LocalWindowManager.addView(Window.java:424)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.Dialog.show(Dialog.java:241)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.AlertDialog$Builder.show(AlertDialog.java:810)
07-31 19:48:18.667: E/WindowManager(2866): at com.myproj.activities.ScheduleBoard.displayNoStoriesMessageAndExit(ScheduleBoard.java:114)
07-31 19:48:18.667: E/WindowManager(2866): at com.myproj.activities.ScheduleBoard.populateTable(ScheduleBoard.java:62)
07-31 19:48:18.667: E/WindowManager(2866): at com.myproj.activities.ScheduleBoard.onCreate(ScheduleBoard.java:56)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
07-31 19:48:18.667: E/WindowManager(2866): at android.os.Handler.dispatchMessage(Handler.java:99)
07-31 19:48:18.667: E/WindowManager(2866): at android.os.Looper.loop(Looper.java:130)
07-31 19:48:18.667: E/WindowManager(2866): at android.app.ActivityThread.main(ActivityThread.java:3687)
07-31 19:48:18.667: E/WindowManager(2866): at java.lang.reflect.Method.invokeNative(Native Method)
07-31 19:48:18.667: E/WindowManager(2866): at java.lang.reflect.Method.invoke(Method.java:507)
07-31 19:48:18.667: E/WindowManager(2866): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
07-31 19:48:18.667: E/WindowManager(2866): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
07-31 19:48:18.667: E/WindowManager(2866): at dalvik.system.NativeStart.main(Native Method)