Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set image from android.R.drawable in image view android

i know how to set image/icon from our res/drawable

<ImageView android:id="@+id/ImageSearch"      android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:src="@drawable/android_green_3d"/> 

If we set it directly from the code: imageView1.setImageResource(R.drawable.android_green_3d);

But we can also get the icon from android.R.drawable like this: imageView1.setImageResource(android.R.drawable.ic_menu_more);

How to set image/icon in xml id the source is android.R.drawable? Anyone know? Thanks in advance.

like image 628
user430926 Avatar asked Sep 10 '10 08:09

user430926


People also ask

How do you set the content of an ImageView in your XML layout File?

Navigate to the app > res > layout > activity_main. xml and add the below code to that file.


1 Answers

Thats easy: change @drawable/ to @android:drawable/. Code completion didn't work in this case, so you should search in the GIT repository or online for the images and their names

like image 108
WarrenFaith Avatar answered Sep 18 '22 00:09

WarrenFaith