android.widget.ProgressBar can't use method with RemoteViews: setVisibility(int)

在使用Notification显示progressbar的时候,

remoteViews.setViewVisibility(R.id.progressbar_id, View.VISIBLE);

 这个用法是错误的。

android.widget.ProgressBar can't use method with RemoteViews: setVisibility(int)

 解决办法:

关于通知栏有进度条的一个异常的处理:

android.widget.RemoteViews$ActionException: view: android.widget.ProgressBar can't use method with RemoteViews: setVisibility(int)

需要将progressbar放在一个layout里面,

隐藏的时候隐藏layout,

而不是隐藏progressbar

http://www.eoeandroid.com/home.php?mod=space&uid=594702&do=blog&id=3035

猜你喜欢

转载自justwyy.iteye.com/blog/1873339