Libraryless. Click here for Pure Java version (1741L/11K).
1 | import android.view.*; |
2 | import android.view.Menu; |
3 | import android.view.MenuItem; |
4 | |
5 | svoid aRemoveItemFromMenu(final Menu menu, fS title) { |
6 | if (menu == null || title == null) ret; |
7 | androidUI { |
8 | for (int i = 0; i < menu.size(); i++) { |
9 | MenuItem item = menu.getItem(i); |
10 | if (eqic(str(item.getTitle()), title)) { |
11 | int id = item.getItemId(); |
12 | print("Removing menu item " + id); |
13 | int n = menu.size(); |
14 | menu.removeItem(id); |
15 | bool removed = menu.size() < n; |
16 | if (!removed) print("Could not remove menu item"); |
17 | else { print("Removed"); i--; } |
18 | } |
19 | } |
20 | } |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023366 |
Snippet name: | aRemoveItemFromMenu |
Eternal ID of this version: | #1023366/13 |
Text MD5: | 24607894b458ba5efaf0d006c61f6f00 |
Transpilation MD5: | 2116375df7e71ef270e2fbc679d10ed2 |
Author: | stefan |
Category: | javax / android |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-06-10 15:55:20 |
Source code size: | 635 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 339 / 452 |
Version history: | 12 change(s) |
Referenced in: | [show references] |