0

I have a MainActivity (extends activity) and created a DialogFragment in a separate file. In order to show this DialogFragment, do I have to create a FragmentActivity or can I achieve this in MainActivity or should I convert my MainActivity to FragmentActivity? Because the following show function does not work in MainActivity:

private void showEditDialog() {
    FragmentManager fm = getSupportFragmentManager();
    EditNameDialog editNameDialog = new EditNameDialog();
    editNameDialog.show(fm, "fragment_edit_name");
4

0 回答 0