I am looking for a way to pass data from an activity onto a dialog box. I am trying to call showDialog(int);, however i don’t see a way to pass any data to the dialog box.
I need to pass a string to the dialog box in order to display a confirmation 🙂
Cheers
If you are targeting Android 2.2 (API Level 8 or higher) you can use
And pass your arguments in
Bundle. See documentation.If you want to support older Android versions, you should save your arguments in
Activityclass members and then access them from youronPrepareDialogfunction. Note thatonCreateDialogwon’t fit your needs as it’s called only once for dialog creation.