0

I'm currently working on a cloud wallpaper application built from source code on Github. While going through the code I found that two icons are pulled from the Android resources. I'm curious how I can make it so that the icons are resources in my /assets or /drawable folders.

@Override
public void onPrepareOptionsMenu (Menu menu) {
    menu.add(1, 1, 1, "Save").setIcon(android.R.drawable.ic_menu_save).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
    menu.add(2, 2, 2, "Apply").setIcon(android.R.drawable.ic_menu_set_as).setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS);
    super.onPrepareOptionsMenu(menu);
}
  • Put them in your `/drawable*` folders, and then, in your code example, you can refer to them like this: `R.drawable.image_name_without_extension`. – Mike M. Jul 15 '14 at 06:11
  • It gives me an error "ic_download cannot be resolved or is not a field". Maybe I need to reference it somewhere else? – Infinite1224 Jul 15 '14 at 06:17
  • If you just now copied them to the folders, you'll probably need to rebuild your project. – Mike M. Jul 15 '14 at 06:18

0 Answers0