skip to Main Content

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 ..

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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">
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search