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
I know this question is old, but you can use the setArguments
method if you are using a custom dialog.
String myString = "How to do it"
DialogFragment newFragment = new AddUserDialog();
Bundle args = new Bundle();
args.putString("number", myString); //The first parameter is the key that will be used to retrieve the value, which is the second parameter.
newFragment.setArguments(args);
newFragment.show(getSupportFragmentManager(), "add_a_member");