inside Android Dialog, how to setup onActivityResult for startActivityForResult?

后端 未结 5 1470
一个人的身影
一个人的身影 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:34

    if your dialog is a dialog fragment you can use

    getActivity().startActivityForResult(intent);
    

    in this way the result is sent to the activity that created the dialog

提交回复
热议问题