I want to make a Battery app which should notify the battery percentage to user in form of image. Now for battery percentage 0-100, I need 101 images in all. What I want to do is that is it possible to insert all these images in an array and use them accordingly. For instance, if my battery percentage is 47%, the image in array at position 47 should be the resource. That is, suppose I have ImageView named Battery, and I have an array named batteryimage(containing all the 101 images) then I should be able to do this,
Battery.setBackgroundResource(R.drawable.batteryimage[p])
where p will be the current percentage of battery, which I will get by code.
Hope you all understood what I want.. Thanx in advance..