Dear can we use onclick with menu item in xml. like below .i tried it but its not working.
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/logout"
android:onClick="onLogOut"
android:title="@string/logout">
</item>
Java Code :
public void onLogOut(MenuItem v) {
Utility.LogError(TAG, "onLogOut Clicked");
Toast.makeText(this, "onLogOut", Toast.LENGTH_SHORT).show();
}
}
onLogOut is not get called....