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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to