Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android RemoteView中的RecyclerView_Android_Android Recyclerview_Remoteview - Fatal编程技术网

Android RemoteView中的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

有没有办法在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.notification_layout)
val mBuilder = NotificationCompat.Builder(this)
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setContent(contentView)

不,你不能。通知具有固定的最大大小,即使您可以发送自定义RemoteView,也没有使用ListView或RecyclerView并使用适配器填充它们的选项