0

Fairly new at android dev, haven't got any code for this particular step yet so ill try give as much detail as possible. I'm trying to make an ImageView object move around the android view/activity, unlike java im not able to use the random generator to translate it onto an x and or y position on the frame, if anyone could point me on the right direction or more importantly have a good idea on how to do this, that'd be great.

MJJLAM
  • 163
  • 1
  • 13

1 Answers1

0

There is a class in android called Random. And there is a function called nextInt() which can give you a random number. You can also calculate the width and height of your screen using DisplayMetrices so that you can keep the image inside the device's screen. And you can also move the ImageView. See this link.

Community
  • 1
  • 1
berserk
  • 2,690
  • 3
  • 32
  • 63