Not Able To Get The Overflow Feature For Actionbar In Android
What i am trying to do :: What is happening :: My code:: actionbar_sort_menu.xml
Solution 2:
- Well This was just a workaround to get the answer as below
- Since i am not having the device to test for the solution to test Raghunandan answer
- I still believe Raghunandan answer holds good & also sharing what i came to do
Reason for me to test on mobile because:: "device has a menu-button, the overflow-icon won't show."
Code::
@OverridepublicbooleanonOptionsItemSelected(MenuItem item) {
ft = getFragmentManager().beginTransaction();
switch(item.getItemId()) {
case R.id.descriptionID:
onItemChangeBackground(1);
FragmentfragContents= FrgBufDetails.newInstance(buf_off_id);
ft.replace(R.id.content_frame, fragContents);
ft.addToBackStack(null);
ft.commit();
returntrue;
case R.id.MapID:
onItemChangeBackground(2);
FragmentfragMap= FrgBufLocation.newInstance(buf_off_id);
ft.replace(R.id.content_frame, fragMap);
ft.addToBackStack(null);
ft.commit();
returntrue;
case R.id.galleryID:
onItemChangeBackground(3);
FragmentfragGallery= FrgBufGallery.newInstance(buf_off_id);
ft.replace(R.id.content_frame, fragGallery);
ft.addToBackStack(null);
ft.commit();
returntrue;
case R.id.inviteID:
onItemChangeBackground(4);
Viewtitle= (View) getActivity()
.findViewById(R.id.inviteID);
//Creating the instance of PopupMenuPopupMenupopup=newPopupMenu(getActivity(), title);
//Inflating the Popup using xml file
popup.getMenuInflater().inflate(R.menu.actionbar_sort_menu, popup.getMenu());
popup.show();//showing popup menureturntrue;
}
returnsuper.onOptionsItemSelected(item);
}
Post a Comment for "Not Able To Get The Overflow Feature For Actionbar In Android"