Link to home
Start Free TrialLog in
Avatar of Max Destiny
Max DestinyFlag for United States of America

asked on

Android Studio images

Hi can i use hard disk files to check if an android app works?


well i have this xml in Android Studio:

<Button
        android:id="@+id/newbutton"
        android:layout_width="200dp"

        android:layout_height="49dp"
        android:layout_marginRight="48dp"
        android:layout_marginTop="216dp"

        android:onClick="Work"

        android:text="Click me"

        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <ImageView
        android:id="@+id/imageview"
        android:layout_width="317dp"


        android:layout_height="173dp"

        android:layout_marginRight="16dp"


        android:layout_marginTop="16dp"
        app:layout_constraintRight_toRightOf="parent"

        app:layout_constraintTop_toTopOf="parent" />

Open in new window


and this code

 public void Work(View view)
    {


      ImageView imageView = findViewById(R.id.imageview);


      Bitmap bmp = BitmapFactory.decodeFile("C:\\Users\\Roald Gallowey\\Pictures\\data.jpg");

      imageView.setImageBitmap(bmp);









    }

Open in new window


but every time i start th simulator and the app it doesnt show me my image?

Where am i wrong?
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial