Close the current activity when you only have a reference to Context

前端 未结 7 1635
暗喜
暗喜 2020-12-12 23:47

If I have a reference to Context, is it possible to finish the current activity?

I don\'t have the reference to current activity.

相关标签:
7条回答
  • 2020-12-13 00:14

    yes, with a cast:

    ((Activity) ctx).finish();
    
    0 讨论(0)
提交回复
热议问题