Home > Net >  Image not showing in android studio emulator
Image not showing in android studio emulator

Time:01-16

i don't know what is the problem with my android studio i am trying to add an image from image view ..it is showing in design tab but not in emulator ...i am a newbie ..please help me fix it ..thanksAndroid Studio

i tried fixing it by changing the attributes but didnt work ..

CodePudding user response:

You are setting a sample_image to an imageView. To set an image, give it a real source.

android:src="@drawable/any_image"

give source of an image drawable

CodePudding user response:

Download any jpg or png image from google and paste that image in drawable folder than add this line in to you imageview widget -> android:src="@drawable/TestImage"

like this->

<ImageView
    android:id="@ id/imageview"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:src="@drawable/TestImage">
  • Related