0

I have an activity that opens a menu (DialogFragment) that's being used to delete items from a list view. Information about the list item that was selected is being passed to the menu in the form of arguments ie.

    DialogFragment dialog = new DialogFragment();
                    Bundle args = new Bundle();
                    args.putInt("VariableName", 42);
                    dialog.setArguments(args);
                    dialog.show(manager, "Dialog Menu");

This way I can access the variable from inside the menu. My question is how can I, upon closing the menu, call some function in the activity.

Cread Dotson
  • 982
  • 1
  • 7
  • 18

1 Answers1

0

You can extend the DialogFragment class and override onDimiss method, get the activity and execute the code.

Check this answer: https://stackoverflow.com/a/23786151/2828400

Community
  • 1
  • 1
Ahmed Gamal
  • 338
  • 2
  • 7