Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2021 07:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Android Studio AlertDialog Pass Values to DialogFragment 1
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
public void showDialog(View view) {
// DialogFragmentの用意
DialogFragment dialogFragment = new MyDialogFragment();
// 渡す値をセット
Bundle args = new Bundle();
args.putString("title", "こんにちは");
args.putInt("number", 123);
// ダイアログを表示, "my_dialog");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment