I have a customized Dialog. In this Dialog, there’s one Button and one TextView. When I click the button, I open a new activity. This activity is a kind of file explorer written by myself. I use a ListView to show the file name. I want to close this activity when I click item of the ListView and return to the dialog. I also want to write the item’s title to the TextView in the Dialog.
Now I just don’t know how to return to the Dialog? I only know how to return to a new activity.
Thanks.
Open startActivityForResult to start the filemanager activity. After the user has chosen the file set a result with setResult. This allows you to fill a data bundle that is returned to the activity that startet the filemanager. Now finish the filemanager activity.
The activity that created the dialog will get the data bundle in onActivityResult.