I'm converting my Android application to use fragments. Previously, I had an activity that is now a fragment. Hence, this code can no longer be used:
showDialog(CONFIRM_ID);
// ...
@Override
public Dialog onCreateDialog(int id) {
// Create the confirmation dialog...
}
From within the Fragment
object, I need to show a confirmation dialog that after confirmation throws me back to the object for status update.
E.g.
- Inside fragment X.
- Show confirmation dialog.
- If "yes" update UI for X.
How can I accomplish this? Please provide working sample code.