RemoteView 異常

01-03 13:20:36.687: E/AndroidRuntime(8513): FATAL EXCEPTION: main

01-03 13:20:36.687: E/AndroidRuntime(8513): android.app.RemoteServiceException: Bad notification posted from package com.zl: Couldn't expand RemoteViews for: StatusBarNotification(package=com.zl id=224968 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x2))

01-03 13:20:36.687: E/AndroidRuntime(8513): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1048)

01-03 13:20:36.687: E/AndroidRuntime(8513): at android.os.Handler.dispatchMessage(Handler.java:99)

01-03 13:20:36.687: E/AndroidRuntime(8513): at android.os.Looper.loop(Looper.java:130)

01-03 13:20:36.687: E/AndroidRuntime(8513): at android.app.ActivityThread.main(ActivityThread.java:3687)

01-03 13:20:36.687: E/AndroidRuntime(8513): at java.lang.reflect.Method.invokeNative(Native Method)

01-03 13:20:36.687: E/AndroidRuntime(8513): at java.lang.reflect.Method.invoke(Method.java:507)

01-03 13:20:36.687: E/AndroidRuntime(8513): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)

01-03 13:20:36.687: E/AndroidRuntime(8513): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)

01-03 13:20:36.687: E/AndroidRuntime(8513): at dalvik.system.NativeStart.main(Native Method)

 

該bug目前只發現會在 Samsung S5830i(系統版本:android 2.3.6) 上出現

bug產生原因:

Notification n = new Notification();
RemoteViews expandedView = new RemoteViews("com.zl.MainActivity",
						R.layout.status_progress_bar);
n.contentView = expandedView;

 R.layout.status_progress_bar 使用了自定義的 ProgressBar的子類,導致報找不到該類的錯誤

RemoteViews 

不過這個bug在其他機器上沒有出現過

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章