inside Android Dialog, how to setup onActivityResult for startActivityForResult?

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

    You can declare your Activity to have a Dialog theme. Look into this SO question: Android Activity as a dialog

    You would change this in your AndroidManifest.xml file:

    
    

    You should be able to use startActivityForResult() like normal. I know the BluetoothChat example Android program uses something similar to return the Bluetooth device that you choose from a Dialog list.

提交回复
热议问题