android - Start Action Mode from custom CursorAdapter within ListFragment -
i trying start action mode contextual action bar, i'm having issues. using custom cursoradapter class extends listfragment contained class extends actionbaractivity.
structure
gamelistactivity (actionbaractivity)
---- gamelistfragment (listfragment)
---- ---- custom_adapter (cursoradapter)
i'm trying start action mode in onclick listener within custom_adapter. currently, have actionmode.callback in actionbaractivity:
public static final actionmode.callback anactionmode = new actionmode.callback() { // standard funcs (oncreateactionmode, etc) }
i feel though better suited in listfragment, i've tried no better luck.
in custom cursoradapter, have function:
private void set_action_mode() { if (checked_count > 0) if (!is_action_mode_showing) ((gamelistactivity) m_context).startactionmode(gamelistactivity.anactionmode); }
the error getting is:
error:(142, 47) error: method startactionmode in class activity cannot applied given types; required: android.view.actionmode.callback found: android.support.v7.view.actionmode.callback reason: actual argument android.support.v7.view.actionmode.callback cannot converted android.view.actionmode.callback method invocation conversion
both classes import (what think) proper class:
import android.support.v7.view.actionmode;
i original following this link, implementation doesn't appear work me either.
is there anyway i'm doing?
i think should use
startsupportactionmode
instead of
startactionmode
hope helpful!
ps: take of sintaxis. java convention says name of variables, objects or methods must start lowercase , no underscores allowed. seems you're using style of c naming. can find more info @ oracle tutorials , here.
Comments
Post a Comment