Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Using resources in WebView

Using resources in WebView

Put your problem here if it does not fit any of the other categories.

Using resources in WebView

Postby rellimcire » Sat Dec 13, 2008 7:53 pm

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?
rellimcire
Freshman
Freshman
 
Posts: 2
Joined: Tue Dec 02, 2008 7:49 am
Location: Lancaster, CA

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot], MSNbot Media and 8 guests