Max Destiny
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:
and this code
but every time i start th simulator and the app it doesnt show me my image?
Where am i wrong?
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" />
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);
}
but every time i start th simulator and the app it doesnt show me my image?
Where am i wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.