How to refresh a view in main activity from an adapter?

后端 未结 4 627
隐瞒了意图╮
隐瞒了意图╮ 2021-01-27 12:03

I have a graph in main activity also I have a recycler view in main activity. Custom adapter is used for recyclerview. I have a check box and swipe layout in list item layout. i

4条回答
  •  隐瞒了意图╮
    2021-01-27 12:40

    In the adapter, you should not create a new instance of MainActivity and call resetGraph(). You should use the instance of MainActivity, that created the adapter. Send the instance of MainActivity to the adapter, new Adapter(this) and save it in adapter.

提交回复
热议问题