Thursday, 8 January 2015

Change contextual action bar(CAB) done button icon.

1) http://stackoverflow.com/questions/11642877/how-to-recognize-whether-the-done-button-is-clicked-in-actionmode

ActionMode mMode = MyActivityClass.this.startActionMode(some implementation);
int doneButtonId = Resources.getSystem().getIdentifier("action_mode_close_button", "id", "android");
View doneButton = MyActivityClass.this.findViewById(doneButtonId);
doneButton.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
        // do whatever you want 
        // in android source code it's calling mMode.finish();
    }
});



1 comment:

  1. Contextual Action mode in android studio

    http://themasterworld.com/working-with-contextual-action-mode-android-studio/

    ReplyDelete