我是 Android 技术的新手,我正在创建一个练习应用程序。我创建了一个用于两个活动的邮件发送类。在一个活动中它工作正常,但在另一个活动中它不工作 - logcat 中有一个错误,我无法找到导致它的原因。这是错误日志:
03-19 12:11:23.773: E/WindowManager(891): Activity com.example.mytest.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{40d0de70 V.E..... R.....ID 0,0-97,92} that was originally added here
03-19 12:11:23.773: E/WindowManager(891): android.view.WindowLeaked: Activity com.example.mytest.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{40d0de70 V.E..... R.....ID 0,0-97,92} that was originally added here
03-19 12:11:23.773: E/WindowManager(891): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:354)
03-19 12:11:23.773: E/WindowManager(891): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:216)
03-19 12:11:23.773: E/WindowManager(891): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
03-19 12:11:23.773: E/WindowManager(891): at android.app.Dialog.show(Dialog.java:281)
03-19 12:11:23.773: E/WindowManager(891): at com.example.mytest.MainActivity$CountDownTask.onPreExecute(MainActivity.java:289)
03-19 12:11:23.773: E/WindowManager(891): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
03-19 12:11:23.773: E/WindowManager(891): at android.os.AsyncTask.execute(AsyncTask.java:534)
03-19 12:11:23.773: E/WindowManager(891): at com.example.mytest.MainActivity.CallLogsBackup(MainActivity.java:91)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invoke(Method.java:511)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View$1.onClick(View.java:3592)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View.performClick(View.java:4202)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View$PerformClick.run(View.java:17340)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Handler.handleCallback(Handler.java:725)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Handler.dispatchMessage(Handler.java:92)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Looper.loop(Looper.java:137)
03-19 12:11:23.773: E/WindowManager(891): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invoke(Method.java:511)
03-19 12:11:23.773: E/WindowManager(891): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-19 12:11:23.773: E/WindowManager(891): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-19 12:11:23.773: E/WindowManager(891): at dalvik.system.NativeStart.main(Native Method)