2013-02-25 82 views
1

我正尝试使用远程视图创建自定义通知。获取android.app.RemoteServiceException:从自定义通知中的包中发布的错误通知

步骤如下:
1.创建一个布局,并放置在res /布局文件夹
2.扩展的RemoteViews类和实施了一些辅助方法。
3.实例化Extended类的一个对象,我通过使用Notification.Builder中的setContent()将它作为Content提供。
4.缓存实例化的Extended类。

现在大多数情况下,即使在将扩展类对象提供给Notification.Builder之前执行操作时,它也会崩溃。

E/AndroidRuntime(10194): android.app.RemoteServiceException: Bad notification posted from 
package com.motorolasolutions.ptt.mpttclient: Couldn't expand RemoteViews for: 
StatusBarNotification 

我已经尝试了以下功能

setBoolean(R.id.textview1, "setEnabled", false); 

请让我知道我可以调用的远程视图的功能。

我尝试了很多在Android源代码中拥有@ android.view.RemotableViewMethod标记的函数。

回答

1

事件“setEnabled”函数在基类(View.java)中具有@RemotableViewMethod标记。这在派生类中被重写,并且没有@RemotableViewMethod标记。我们必须检查子类的标签是否被覆盖。