Thanks Alexey! It worked great!

On Aug 2, 3:14 pm, Alexey Krasnoriadtsev <[email protected]>
wrote:
> you can place your images directly under assets directory, and then
> use getResources().getAssets().open("path to file");
>
> On Jul 31, 1:55 pm, DroidDude <[email protected]> wrote:
>
> > Hi,
>
> > I am very new to Android Development and I have a doubt regarding
> > Image Loading in ImageView from R.drawable.
>
> > Just to brief What I am trying to accomplish is :Showing a ListView
> > with ImageView and TextView using ViewWrapper pattern.
>
> > I get the Text Value for TextView from one http service and I store
> > all the values in String Array. I have implemented my own Adapter with
> > my own implementation of getView().
>
> > Now the issue:
>
> > I have put all the images i want to show in res/drawable folder. now
> > based on the value of text I want to pick that image from the folder
> > and show it in the Imageview.
>
> > For Example:
> > if i get "aaa" as the value of TextView. I already have aaa.jpg in res/
> > drawable folder and I want to set that image in ImageView.
>
> > I don't know how to get the handle for aaa.jpg in androind.
>
> > I have tried follwoing with no luck:
> > ImageView.setImageResource() - But it takes the rID as argument which
> > is of type int. I cant generate "R.drawable."+myVairable.
>
> > ImageView.setImageDrawable(Drawable.createFromPath(PATHVariable))-But
> > I don't know how to give the path to the image. I tried "./res/
> > drawable/"+variable+".jpg"
>
> > BitmapFactory takes the similar argument for all its method.
>
> > I really don't want to write any Async Image Loader based on any
> > server based URIs as I dont have any hosting server available.
>
> > Kindly help.
>
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to