inside Android Dialog, how to setup onActivityResult for startActivityForResult?

后端 未结 5 1440
一个人的身影
一个人的身影 2021-02-18 21:44

From an activity, I can easily setup the onActivityResult() and call startActivityForResult() and everything works fine.

Now, I need to call <

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-18 22:29

    On the dialog constructor pass the reference of parent Activity, then you can use in the dialog like this,

    parentActivity.startActivityForResult(intent, CODE);
    

提交回复
热议问题