menu键菜单显示图标:

 

import java.lang.reflect.Method;
......

@Override
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.fm_action_bar_funui, menu); try { Class<?> clazz = Class.forName("com.android.internal.view.menu.MenuBuilder"); Method m = clazz.getDeclaredMethod("setOptionalIconsVisible", boolean.class); m.setAccessible(true); m.invoke(menu, true); } catch (Exception e) { e.printStackTrace(); } return true; }

 

posted @ 2015-08-03 10:32  williamgufeng  阅读(856)  评论(0编辑  收藏  举报