Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Last active November 11, 2023 03:57
Show Gist options
  • Save codeforfun-jp/14c44139671b64d6e0a6cec360d716ca to your computer and use it in GitHub Desktop.
Save codeforfun-jp/14c44139671b64d6e0a6cec360d716ca to your computer and use it in GitHub Desktop.
How to create dialog series 1 basic - java 3
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.btn).setOnClickListener(view -> {
DialogFragment dialogFragment = new MyDialogFragment();
dialogFragment.show(getSupportFragmentManager(), "my_dialog");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment