c# - Fragment Manager error : An object reference is required for the non-static field, method, or property -
im getting error: object reference required non-static field, method or property 'android.app.fragmentmanager.begintransaction()' in line : fragmenttransaction transaction = fragmentmanager.begintransaction();
void meditar_click (object sender, eventargs e ) { fragmenttransaction transaction = fragmentmanager.begintransaction(); dialog_editar_produto dialog_editar = new dialog_editar_produto (); dialog_editar.show (transaction, "dialog fragment"); dialog_editar.moneditarcomplete += dialog_editar_moneditarcomplete; }
what can do?
that error message indicates begintransaction not static method of fragmentmanager class. try accessing fragmentmanager object in class.
try this:
fragmenttransaction transaction = this.fragmentmanager.begintransaction();
Comments
Post a Comment