android - Error showing support.v7.AppCompatDialogFragment using show() method -
i using v7 support appcompatdialogfragment in app
import android.support.v7.app.appcompatdialogfragment; public class logindialogfragment extends appcompatdialogfragment { }
throughout app using default fragment
, fragmentmanager
, not android.support.v4.app.fragment
or adroid.support.v4.app.fragmentmanager
import android.app.fragment; import android.app.fragmentmanager;
now problem want show dialog activity calling method
public void show(@notnull android.support.v4.app.fragmentmanager manager, java.lang.string tag)
which does not accept android.app.fragmentmanager
parameter.
so can't call
logindialogfragment logindialogfragment = new logindialogfragment(); logindialogfragment.show(getfragmentmanager(), "tag");
how show dialog ?
you can't use native fragment
support appcompatdialogfragment. in fact, if check closer import of appcompatdialogfragment
, find out comes support library. have use getsupportfragmentmanager()
instead of getfragmentmanager()
. like
logindialogfragment.show(getsupportfragmentmanager(), "tag");
everything appcompat* support library
Comments
Post a Comment