找不到类的android.app.Notification $生成器 [英] Could not find class 'android.app.Notification$Builder
本文介绍了找不到类的android.app.Notification $生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经加入到我的项目的libralies安卓支持,v4.jar ...但我得到这个错误:
I have add into my project's libralies the andriod-support-v4.jar... but I am getting this error:
Could not find class 'android.app.Notification$Builder', referenced from method org.secure.sms.SmsReceiver.showNotification
Could not find class 'android.support.v4.app.NotificationCompat$Builder', referenced from method org.secure.sms.SmsReceiver.createNotification
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.support.v4.app.NotificationCompat$Builder
at org.secure.sms.SmsReceiver.createNotification(SmsReceiver.java:108)
at org.secure.sms.SmsReceiver.onReceive(SmsReceiver.java:136)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794)
at android.app.ActivityThread.access$2400(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
问题出在哪里?
截图: http://i.stack.imgur.com/I95ke.jpg
推荐答案
一定要有 Android的支持 - v4.jar
您的文件夹内 /库
并添加到您的类:
be sure to have android-support-v4.jar
inside your folder /libs
and add this to your class:
import android.support.v4.app.NotificationCompat;
这篇关于找不到类的android.app.Notification $生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文