-
-
Save scan/658d751c3ffd167b1f65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { | |
menu = new MenuWrapper(menu) { | |
private MenuItem fix(MenuItem item) { | |
try { | |
Field f = item.getClass().getDeclaredField("mEmulateProviderVisibilityOverride"); | |
f.setAccessible(true); | |
f.set(item, Boolean.FALSE); | |
} catch (Throwable e) { | |
e.printStackTrace(); | |
} | |
return item; | |
} | |
@Override | |
public MenuItem add(CharSequence title) { | |
return fix(super.add(title)); | |
} | |
@Override | |
public MenuItem add(int titleRes) { | |
return fix(super.add(titleRes)); | |
} | |
@Override | |
public MenuItem add(int groupId, int itemId, int order, CharSequence title) { | |
return fix(super.add(groupId, itemId, order, title)); | |
} | |
@Override | |
public MenuItem add(int groupId, int itemId, int order, int titleRes) { | |
return fix(super.add(groupId, itemId, order, titleRes)); | |
} | |
}; | |
} | |
inflater.inflate(R.menu.text_selection, menu); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment