Hi i m making an application in which i have put images in drawable folder
the names of images are s5p1.jpg,s5p2.jpg,s5p3.jpg.
User give two inputs in two EditTexts e.g 5 and 2.Now i convert this
user input into s5p2 by concatenating with string.Now i am using Drawable
.CreatePath method to get my required image from drawable folder...But it
couldn't show nothing.Here is my code.Please suggest me some solution.I
know it is a simple problem.I simply google for 2 days but couldn't get
much of it.
ImageView iv;
String path="R.drawable.";
String concat="s"+input1+"p"+input2+".jpg"; //
s5p2.jpg
path = path+concat; //
R.drawable.s5p2.jpg
Drawable d = Drawable.createFromPath(path);
iv.setImageDrawable(d);
Please rep soon.
Thanks in advance.
Regards,
Talha Qamar.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en