-1

I am using android studio 2.1.3, i have import compile 'com.android.support:appcompat-v7:23+'. Now i want to use images from appcompat library in my application module. Please give reply as soon as possible.

I have attached screenshot. Please check image.

enter image description here

Nilesh Patel
  • 419
  • 1
  • 7
  • 15
  • Possible duplicate of [How to set image in imageview in android?](http://stackoverflow.com/questions/13513953/how-to-set-image-in-imageview-in-android) – AshAR Jan 19 '17 at 07:30
  • Please see this link https://stackoverflow.com/a/70844512/12272687 – Mori Jan 25 '22 at 06:57

3 Answers3

2

You cannot do that.Most of the resources in appcompat library is private.This library has public.xml in res/value of it and only the resources defined in this xml are accessible and the rest of the resources are implicitly private and android wouldn't give you suggestion to use them.Your best bet is to download a copy of it and put it in the drawable of your own application so you will be able to refer to them. Resource: https://developer.android.com/studio/projects/android-library.html

AAP
  • 179
  • 1
  • 3
1

For xml- Make an imageview.

Write this inside the image view-

android:src="@drawable/name"

and it shall work

enter image description here

So now click on the clip art icon and there are hundreds of icons and pics. They are probably the same as of the external libraries. Click next for whichever image you want and that will be added to your drawable folder and then you can use it.

AshAR
  • 228
  • 1
  • 14
0

Add imageView in xml and add background.

android:background="@drawable/any_image_you_want"
santosh kumar
  • 2,952
  • 1
  • 15
  • 27