Question

public class MainActivity extends ActionBarActivity {
.
.
.
    public  void show_read_menu(Bundle args){

        Menux editNameDialog = new Menux();
        android.support.v4.app.FragmentManager fm =  getSupportFragmentManager();
        editNameDialog.setArguments(args);
        editNameDialog.show(fm, "fragment_edit_name");

    }
.
.
   public static class Menux extends DialogFragment {
   //nested class

Unable to call the DialogFragment from the main ActionBarActivity class as above getting error on the .show() method :The method show(FragmentManager, String) in the type DialogFragment is not applicable for the arguments (FragmentManager, String)

Was it helpful?

Solution

Answering my own question for some completeness. It seems it was a trivial import issue, Since I was switching from Activity to ActionBarActivity the previous import were causing the issue.

Problem was caused by below imports.

import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.DialogFragment;

Solved the issue by replacing them with...

import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBar.OnNavigationListener;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top