3

我在我的应用程序中遇到了 AsynsTask 的问题。我真的不明白它发生的原因。

问题是“该应用程序通常可以正常工作,现在当activity屏幕上显示任何一个并且我让我的设备长时间闲置时。然后当我在最后一个活动活动的视图上显示键盘保护时我。但是只要我点击下面提到的任何组件就会抛出异常。如果设备没有保存更长的时间,那么没有问题。应用程序在大多数活动的 onResume 中建立 http 连接。我这样做是因为每次用户进入特定视图时,他都应该从网络服务中获取帖子的更新列表”

W/AsyncTask(18829): java.lang.InterruptedException
W/AsyncTask(18829):     at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1254)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:219)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask.get(FutureTask.java:82)
W/AsyncTask(18829):     at android.os.AsyncTask$3.done(AsyncTask.java:196)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerCancel(FutureTask.java:293)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask.cancel(FutureTask.java:75)
W/AsyncTask(18829):     at android.os.AsyncTask.cancel(AsyncTask.java:325)
W/AsyncTask(18829):     at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:73)
W/AsyncTask(18829):     at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)
W/AsyncTask(18829):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/AsyncTask(18829):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/AsyncTask(18829):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
W/AsyncTask(18829):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
W/AsyncTask(18829):     at java.lang.Thread.run(Thread.java:1096)
W/InputManagerService(   85): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44daac80
D/NetworkStateTracker(   85): setDetailed state, old =CONNECTED and new state=DISCONNECTED
D/NetworkStateTracker(   85): setDetailed state, old =CONNECTED and new state=OBTAINING_IPADDR
D/WifiStateTracker(   85): DhcpHandler: DHCP request started
D/ConnectivityService(   85): ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDR
D/ConnectivityService(   85): Dropping ConnectivityChange for WIFI: CONNECTING/OBTAINING_IPADDR
I/AudioHardwareQSD(   59): AudioHardware pcm playback is going to standby.
I/System.out(18829): URL for Subsection Bookmark reply ==> http://www.softwebdemo.com/viral/babbleville/services/getvilledetails.php?action=getbookmarksubsection&Userid=51&start=0&end=30
W/dalvikvm(18829): threadid=10: thread exiting with uncaught exception (group=0x4001d7f0)
E/AndroidRuntime(18829): FATAL EXCEPTION: AsyncTask #3
E/AndroidRuntime(18829): java.lang.RuntimeException: An error occured while executing doInBackground()
E/AndroidRuntime(18829):    at android.os.AsyncTask$3.done(AsyncTask.java:200)
E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
E/AndroidRuntime(18829):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
E/AndroidRuntime(18829):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
E/AndroidRuntime(18829):    at java.lang.Thread.run(Thread.java:1096)
E/AndroidRuntime(18829): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
E/AndroidRuntime(18829):    at android.os.Handler.<init>(Handler.java:121)
E/AndroidRuntime(18829):    at android.app.Dialog.<init>(Dialog.java:101)
E/AndroidRuntime(18829):    at android.app.AlertDialog.<init>(AlertDialog.java:63)
E/AndroidRuntime(18829):    at android.app.AlertDialog.<init>(AlertDialog.java:59)
E/AndroidRuntime(18829):    at android.app.AlertDialog$Builder.create(AlertDialog.java:786)
E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.AlertOnInternetConnetion(BabbleVilleSyncTask.java:188)
E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.checkInternetConnetion(BabbleVilleSyncTask.java:169)
E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:57)
E/AndroidRuntime(18829):    at com.babbleville.utils.BabbleVilleSyncTask.doInBackground(BabbleVilleSyncTask.java:1)
E/AndroidRuntime(18829):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/AndroidRuntime(18829):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
E/AndroidRuntime(18829):    ... 4 more
W/ActivityManager(   85):   Force finishing activity com.babbleville/.VilleBookmarkReply
E/WindowManager(18829): Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44a25940 that was originally added here
E/WindowManager(18829): android.view.WindowLeaked: Activity com.babbleville.VilleBookmarkReply has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@44a25940 that was originally added here
E/WindowManager(18829):     at android.view.ViewRoot.<init>(ViewRoot.java:247)
E/WindowManager(18829):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
E/WindowManager(18829):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/WindowManager(18829):     at android.view.Window$LocalWindowManager.addView(Window.java:424)
E/WindowManager(18829):     at android.app.Dialog.show(Dialog.java:241)
E/WindowManager(18829):     at com.babbleville.utils.BabbleVilleSyncTask.onPreExecute(BabbleVilleSyncTask.java:48)
E/WindowManager(18829):     at android.os.AsyncTask.execute(AsyncTask.java:391)
E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.loadSubsectionBookmark(VilleBookmarkReply.java:1186)
E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.loadBookmarkSubsection(VilleBookmarkReply.java:1171)
E/WindowManager(18829):     at com.babbleville.VilleBookmarkReply.onClick(VilleBookmarkReply.java:277)
E/WindowManager(18829):     at android.view.View.performClick(View.java:2408)
E/WindowManager(18829):     at android.view.View$PerformClick.run(View.java:8816)
E/WindowManager(18829):     at android.os.Handler.handleCallback(Handler.java:587)
E/WindowManager(18829):     at android.os.Handler.dispatchMessage(Handler.java:92)
E/WindowManager(18829):     at android.os.Looper.loop(Looper.java:123)
E/WindowManager(18829):     at android.app.ActivityThread.main(ActivityThread.java:4627)
E/WindowManager(18829):     at java.lang.reflect.Method.invokeNative(Native Method)
E/WindowManager(18829):     at java.lang.reflect.Method.invoke(Method.java:521)
E/WindowManager(18829):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/WindowManager(18829):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/WindowManager(18829):     at dalvik.system.NativeStart.main(Native Method)
D/NetworkStateTracker(   85): setDetailed state, old =OBTAINING_IPADDR and new state=CONNECTED
D/ConnectivityService(   85): ConnectivityChange for WIFI: CONNECTED/CONNECTED
D/WifiWatchdogService(   85): (android.server.ServerThread) Softwebsolutions (00:25:9c:0c:2d:c0) does not require the watchdog
D/ConnectivityService(   85): adding dns 192.168.3.105 for WIFI
D/Tethering(   85): Tethering got CONNECTIVITY_ACTION
D/Tethering(   85): MasterInitialState.processMessage what=3
E/HierarchicalStateMachine(   85): TetherMaster - unhandledMessage: msg.what=3
I/GTalkService(  214): [ServiceAutoStarter] --- connectivity changed

有人可以让我知道此错误背后的原因以及对此的任何解决方案吗?

4

0 回答 0