Android RemoteView中的RecyclerView
有没有办法在RemoteView中设置和更新RecyclerView? 我想在通知中显示RecyclerView。我已经在通知中设置了自定义视图,但无法在RecyclerView中设置数据,请参见此处:Android RemoteView中的RecyclerView,android,android-recyclerview,remoteview,Android,Android Recyclerview,Remoteview,有没有办法在RemoteView中设置和更新RecyclerView? 我想在通知中显示RecyclerView。我已经在通知中设置了自定义视图,但无法在RecyclerView中设置数据,请参见此处: // my playout passed here have a Recycler View // How to findViewById there and set my data? val contentView = RemoteViews(packageName, R.layout.not
// my playout passed here have a Recycler View
// How to findViewById there and set my data?
val contentView = RemoteViews(packageName, R.layout.notification_layout)
val mBuilder = NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.ic_launcher)
.setContent(contentView)
不,你不能。通知具有固定的最大大小,即使您可以发送自定义RemoteView,也没有使用ListView或RecyclerView并使用适配器填充它们的选项