简体   繁体   English

更新活动中的视图以响应回收者视图项目单击

[英]Update View in Activity in response to recycler view item click

I have this type of activity layout 我有这种活动布局 活动布局

In my layout, the yellow portion is my recyclerview, which is currently working as the expandable list. 在我的布局中,黄色部分是我的recyclerview,目前正在用作可扩展列表。 Now in my scenario, when the user clicks on any item in the recyclerview than the layout changes in the activity shown by, green area and its child in the image. 现在在我的场景中,当用户单击recyclerview中的任何项目时,布局都会在图像中由绿色区域及其子项表示的活动中更改。 Is there any way to do so? 有什么办法吗?

Here is the simple example of pass value from recyclerview to activity using eventbus . 这是使用eventbus从recyclerview传递到活动的传递值的简单示例 Try this maybe will help you to solve your problem. 试试这个也许可以帮助您解决问题。

您可以使用回调方法。单击项目更新UI时会使用回调方法。

是的,您可以使用EventBus轻松实现这一目标

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android-在回收站视图中单击项目退出活动 - Android - exit activity on item click in recycler view 通过单击回收者视图中的项目来更新活动中的视图 - Update views in activity by clicking item in recycler view 项目单击以进入回收站视图 - item click for recycler view 单击警报生成器 Android 中的项目时更改/更新回收站查看项目 - Change/Update Recycler View Item On Click of Item In Alert Builder Android 回收者视图的项目背景不会在点击事件中更新吗? - Recycler view's item background doesn't update on click events? 单击回收者视图中的项目后,在回收者视图中显示子项目 - Show a sub item on the recycler view after click on an item in the recycler view 如何在回收者视图的单个项目中更新视图 - how to update view in a single item of recycler view Android Espresso如何在Recycler View中单击Recycler View中的项目? - How Android Espresso click an item in Recycler View inside Recycler View? 如何在回收站视图点击上移动不同的活动? - How to move a different activity on recycler view click? 回收器视图上的空指针异常项目单击侦听器活动在单击项目时关闭 - Null pointer Exception on Recycler View On item click listener Activity Close when item got clicked
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM