Ralf: Thanks: I have duplicated them and it works. I don't like wasting the storage space, especially since apps need to live in internal memory. Having two copies of many icons seems very wasteful.
Xavier: I have trouble understanding what you are saying. The icons are png files -- they display very well in WebView using standard html (<img src="check_icon.png"/>). The issue is that I don't know how to refer to files in res/drawable. If you're suggesting I convert them to mime format or something, that defeats my purpose of trying to save space. I suppose I could try building the web page on the fly from an html file stored in the res directory, but I think I'd still have the same reference issue. On Dec 14, 8:57 am, Ralf <[email protected]> wrote: > You might have to duplicate them. Resources in /res/drawable and in > /assets are not handled the same way. > > R/ > > On Sat, Dec 13, 2008 at 10:50 AM, Eric <[email protected]> wrote: > > > My app has ImageButtons that use icons in drawable. I want a help page > > that can refer to those icons. I made a help html file and put it in > > assets/help/help.html. Now I can load it using "file:///android_asset/ > > help/help.html". > > > The problem is how do I access the ImageButton icons? Is there a way > > for my html file to refer to the resource directory? > > > I could not find a way, so I thought I'd put the icons in my help > > directory. Now they are easy to acces from my help.html. However, I > > have trouble referring to them from my code. My src code looks like > > this: > > > ImageButton correctAnswerButton = (ImageButton) findViewById > > (R.id.correct_answer); > > File imgFile = new File("/android_asset/help/ > > check_icon.png"); > > correctAnswerButton.setImageURI(Uri.fromFile(imgFile)); > > > This fails. I presume android_asset only works for WebView. I cannot > > find documentation on it anywhere -- I only found out about it from > > this group. > > > Is there a way to load an image from assets? Or better, is there a way > > to refer to resources from an html asset? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

