/*This is my function code*/
Random random = new Random();
int randomInt = random.nextInt()%200;
String imgName = "img" + randomInt;
int ImageId = getResources().getIndentifier(imgName,"drawabale",getPackageName());
myImage.setImageResourse(ImageId);
Previously in my drawable folder there are 200 images already inserted using img1,img2.....img199 like nomenclature... every time I call random function mention below to generated one random number and form a string name starting from "img" and some number. But most of time only 0 is generated by random function and id set to image is display 0th image constantly..at some point it successfully display other images but most of time it generated zero value continuosly.
Thanks in Advance !