How to finish an activity from an Adapter..?

前端 未结 10 618
野趣味
野趣味 2020-12-13 08:39

I tried with passing context of activity into the adapter and then i tried context.finish(); But its giving me one error like The method fini

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 08:55

    i have not used it but i hope it will work. use: "this.recreate()" if you are want to reload it from within the activity.

    if you want to reload it from Adapter then use: "((Activity)context).recreate()"

提交回复
热议问题