I am very new to Eclipse, and have been using it only for a day so far, and also have no previous experience with Java, although I don't know much I still understand how it goes.
Could someone please help me out with a code to randomly generate a picture from my drawings folder?
I got my android application blank and on full screen mode, I have added a picture in imageView1
, fitCenter
'ed it and it really works good, I cleaned out all the errors that occurred along the way also.
This is how my ImageView
code looks so far:
<ImageView
android:id="@+id/imageView1"
android:contentDescription="@string/desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="fitCenter"
android:src="@drawable/img1" />
Now what I really need is that my application only shows a random image, and every time I run the app it shows a different image, and also that once in application, I can On Click
on the image and then it shows a different random image.
I guess I have to add some strings or something, I'm really new to this and don't know much yet.
Really appreciate if you could help me out here :).