Android use DialogFragment in extends ListFragment class -
i have receivelistfragment
class. thats extends listfragment
, want utilize dialogfragment
error :
error:(200, 15) java: no suitable method found show(android.support.v4.app.fragmentmanager,java.lang.string) method android.app.dialogfragment.show(android.app.fragmenttransaction,java.lang.string) not applicable (actual argument android.support.v4.app.fragmentmanager cannot converted android.app.fragmenttransaction method invocation conversion) method android.app.dialogfragment.show(android.app.fragmentmanager,java.lang.string) not applicable (actual argument android.support.v4.app.fragmentmanager cannot converted android.app.fragmentmanager method invocation conversion)
i'm utilize , define code:
fragmentmanager manager = getfragmentmanager(); addnotedialogfragment dialog = new addnotedialogfragment(); dialog.show(manager,"1");
my dialogfragment
class :
public class addnotedialogfragment extends dialogfragment { public addnotedialogfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { getdialog().settitle(getstring(r.string.app_name)); view view = inflater.inflate(r.layout.view_sms_dialog, container); homecoming view; } @override public dialog oncreatedialog(bundle savedinstancestate) { dialog dialog = super.oncreatedialog(savedinstancestate); dialog.getwindow().requestfeature(window.feature_no_title); homecoming dialog; } }
i had similar issue. problem (unconsciously) mixing imports back upwards library. supplying v4
fragment manager, while parameter must native fragmentmanager
.
i had problem vice versa: param should v4
, supplied native fragmentmanager
. had solved issue extending class actionbaractivity
in stead of activity
, called getsupportfragmentmanager()
supply v4
fragment manager.
android android-dialog android-dialogfragment
No comments:
Post a Comment