I used navigation drawer in my Project and also changed drawer icon in inner fragments as back button by refering this link Switching between Android Navigation Drawer image and Up caret when using fragments.. I have 3 fragments and all 3 fragments have different actionbar icons. I go from A fragment to B and B to C. When i clicked on the home button on C onOptionItem Selected on A is working not C
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d("home", "mylike0");
switch (item.getItemId()) {
case android.R.id.home:
return true;
case R.id.action_mylikes1:
Log.d("clicked", "clicked");
return true;
default:
break;
}
return false;
}
In this way i wrote onOptionItemSelected in Fragment. All other menu icons are working.
`
0 comments:
Post a Comment