我开发了一个应用程序,它在模拟器上按预期运行,但在我的设备(HTC one X)中运行它时出错。以下是logcat中显示的错误。有一种方法可以创建通知。createNotification()
调用此方法时出现错误。Logcat 如下:
11-09 13:40:13.350: E/AndroidRuntime(5294): FATAL EXCEPTION: main
11-09 13:40:13.350: E/AndroidRuntime(5294): java.lang.NoClassDefFoundError: android.app.TaskStackBuilder
11-09 13:40:13.350: E/AndroidRuntime(5294): at com.example.accessibility.Accessibility.createNotification(Accessibility.java:205)
11-09 13:40:13.350: E/AndroidRuntime(5294): at com.example.accessibility.Accessibility$1.onClick(Accessibility.java:69)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.view.View.performClick(View.java:3538)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.view.View$PerformClick.run(View.java:14319)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.os.Handler.handleCallback(Handler.java:608)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.os.Handler.dispatchMessage(Handler.java:92)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.os.Looper.loop(Looper.java:156)
11-09 13:40:13.350: E/AndroidRuntime(5294): at android.app.ActivityThread.main(ActivityThread.java:5045)
11-09 13:40:13.350: E/AndroidRuntime(5294): at java.lang.reflect.Method.invokeNative(Native Method)
11-09 13:40:13.350: E/AndroidRuntime(5294): at java.lang.reflect.Method.invoke(Method.java:511)
11-09 13:40:13.350: E/AndroidRuntime(5294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-09 13:40:13.350: E/AndroidRuntime(5294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-09 13:40:13.350: E/AndroidRuntime(5294): at dalvik.system.NativeStart.main(Native Method)
如果有人可以帮助我解决此错误,我将不胜感激。