自定义通知中的自定义进度条

时间:2012-07-16 08:05:24

标签: android android-custom-view android-notifications android-progressbar

我正在尝试使用两个进度条来实现通知。我提到从here自定义通知的进度条。我一直收到这个错误&我无法找到解决方案。请帮助。

    07-16 13:26:30.523: E/StatusBarService(1525): couldn't inflate view for notification mobishare.notify/0x50ae95c1
    07-16 13:26:30.523: E/StatusBarService(1525): android.view.InflateException: Binary XML file line #46: Error inflating class mobishare.notify.customProgressBar
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.widget.RemoteViews.apply(RemoteViews.java:1303)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.systemui.statusbar.StatusBarService.makeNotificationView(StatusBarService.java:597)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.systemui.statusbar.StatusBarService.addNotificationViews(StatusBarService.java:634)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.systemui.statusbar.StatusBarService.addNotification(StatusBarService.java:431)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.systemui.statusbar.CommandQueue$H.handleMessage(CommandQueue.java:201)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.os.Handler.dispatchMessage(Handler.java:99)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.os.Looper.loop(Looper.java:130)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.app.ActivityThread.main(ActivityThread.java:3687)
    07-16 13:26:30.523: E/StatusBarService(1525):   at java.lang.reflect.Method.invokeNative(Native Method)
    07-16 13:26:30.523: E/StatusBarService(1525):   at java.lang.reflect.Method.invoke(Method.java:507)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
    07-16 13:26:30.523: E/StatusBarService(1525):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
    07-16 13:26:30.523: E/StatusBarService(1525):   at dalvik.system.NativeStart.main(Native Method)
    07-16 13:26:30.523: E/StatusBarService(1525): Caused by: java.lang.ClassNotFoundException: mobishare.notify.customProgressBar in loader dalvik.system.PathClassLoader[.]
    07-16 13:26:30.523: E/StatusBarService(1525):   at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
    07-16 13:26:30.523: E/StatusBarService(1525):   at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
    07-16 13:26:30.523: E/StatusBarService(1525):   at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.createView(LayoutInflater.java:471)
    07-16 13:26:30.523: E/StatusBarService(1525):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
    07-16 13:26:30.523: E/StatusBarService(1525):   ... 17 more

修改 或者,如果任何机构可以告诉我如何在通知中添加2个进度条。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

确保自定义进度条的路径在XML文件中正确写入..因为问题是系统无法找到类.. java.lang.ClassNotFoundException: mobishare.notify.customProgressBar