我將一個TimerTask子類化爲定期捕獲圖像和一些傳感器數據以上載到AppEngine服務器。該應用程序完美的作品在模擬器但是當手機(2.2.1)加載和任務計劃與定時器,我得到以下錯誤:定時器IllegalArgumentException
11-18 19:32:45.810: E/AndroidRuntime(685): FATAL EXCEPTION: main
11-18 19:32:45.810: E/AndroidRuntime(685): java.lang.IllegalArgumentException
11-18 19:32:45.810: E/AndroidRuntime(685): at java.util.Timer.schedule(Timer.java:483)
11-18 19:32:45.810: E/AndroidRuntime(685): at com.ms.revolver.CaptureActivity$3.onClick(CaptureActivity.java:77)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.view.View.performClick(View.java:2449)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.widget.CompoundButton.performClick(CompoundButton.java:99)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.view.View$PerformClick.run(View.java:9027)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.os.Handler.handleCallback(Handler.java:587)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.os.Handler.dispatchMessage(Handler.java:92)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.os.Looper.loop(Looper.java:123)
11-18 19:32:45.810: E/AndroidRuntime(685): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-18 19:32:45.810: E/AndroidRuntime(685): at java.lang.reflect.Method.invokeNative(Native Method)
11-18 19:32:45.810: E/AndroidRuntime(685): at java.lang.reflect.Method.invoke(Method.java:521)
11-18 19:32:45.810: E/AndroidRuntime(685): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-18 19:32:45.810: E/AndroidRuntime(685): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-18 19:32:45.810: E/AndroidRuntime(685): at dalvik.system.NativeStart.main(Native Method)
不知道爲什麼它的工作原理在模擬器,但不是電話;有任何想法嗎?
除非您發佈代碼,否則任何人都不可能提供幫助。 – cistearns