I don't know how to catch the back event from a menu :
I mean i want to catch the event when press the back button
on the top left of the screen.
Here the xml file of the menu :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/ActionModeMenu">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<CheckBox
android:id="@+id/context_menu_select_tweet_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:onClick="onSelectAllTweet" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:theme="@style/ActionModeMenuSubtitle"
android:text="@string/menu_tweet_select_all_text"/>
</LinearLayout>
<TextView
android:id="@+id/context_menu_select_tweet_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:theme="@style/ActionModeMenuTitle"/>
</LinearLayout>
Thanks !