Created
May 1, 2012 10:30
-
-
Save granoeste/2567064 to your computer and use it in GitHub Desktop.
[Android]Accessing Internal Resources
This file contains 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
Map<String, Integer> mapResources = new HashMap<String, Integer>(); | |
static final String defType = "drawable"; | |
static final String defPackage = "android"; | |
static final String [] names = { | |
"ic_menu_account_list", | |
"ic_menu_add", | |
"ic_menu_agenda", | |
"ic_menu_allfriends", | |
"ic_menu_always_landscape_portrait", | |
"ic_menu_archive", | |
"ic_menu_attachment", | |
"ic_menu_back", | |
"ic_menu_block", | |
"ic_menu_blocked_user", | |
"ic_menu_call", | |
"ic_menu_camera", | |
"ic_menu_cc", | |
"ic_menu_chat_dashboard", | |
"ic_menu_clear_playlist", | |
"ic_menu_close_clear_cancel", | |
"ic_menu_compass", | |
"ic_menu_compose", | |
"ic_menu_crop", | |
"ic_menu_day", | |
"ic_menu_delete", | |
"ic_menu_directions", | |
"ic_menu_edit", | |
"ic_menu_emoticons", | |
"ic_menu_end_conversation", | |
"ic_menu_forward", | |
"ic_menu_friendslist", | |
"ic_menu_gallery", | |
"ic_menu_goto", | |
"ic_menu_help", | |
"ic_menu_home", | |
"ic_menu_info_details", | |
"ic_menu_invite", | |
"ic_menu_login", | |
"ic_menu_manage", | |
"ic_menu_mapmode", | |
"ic_menu_mark", | |
"ic_menu_month", | |
"ic_menu_more", | |
"ic_menu_my_calendar", | |
"ic_menu_mylocation", | |
"ic_menu_myplaces", | |
"ic_menu_notifications", | |
"ic_menu_play_clip", | |
"ic_menu_preferences", | |
"ic_menu_recent_history", | |
"ic_menu_refresh", | |
"ic_menu_report_image", | |
"ic_menu_revert", | |
"ic_menu_rotate", | |
"ic_menu_save", | |
"ic_menu_search", | |
"ic_menu_send", | |
"ic_menu_set_as", | |
"ic_menu_share", | |
"ic_menu_slideshow", | |
"ic_menu_sort_alphabetically", | |
"ic_menu_sort_by_size", | |
"ic_menu_star", | |
"ic_menu_start_conversation", | |
"ic_menu_stop", | |
"ic_menu_today", | |
"ic_menu_upload", | |
"ic_menu_upload_you_tube", | |
"ic_menu_view", | |
"ic_menu_week", | |
"ic_menu_zoom", | |
}; |
This file contains 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
for (String name : names) { | |
int id = Resources.getSystem().getIdentifier(name, defType, defPackage); | |
// if (id != 0) | |
mapResources.put(name, id); | |
} | |
Log.i(TAG, mapResources.toString()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Android 1.5 drawabke resources http://kapsencode.com/android_drawable/