Browser Application: loading asset html files

by Kumaravel Kandasami » Sat, 14 Feb 2009 05:54:54 GMT

Sponsored Links
 I have html/css/js files in my asset directory. In the MAIN activity class
I am redirecting the display of the html files in my asset directory to the
browser application using Intents.

The browser application is not loading the html page, however if I change
the code to use external URL it works fine.

Not Working:

startActivity (new Intent(Intent.ACTION_VIEW,


startActivity (new Intent(Intent.ACTION_VIEW, Uri.parse(" ")));

I am assuming the Intent are not mapped to the 'scheme' in the url (file
versu http). Anyone have other suggestions.

Thank You.

Kumar    _/|\_
"making a profound difference with knowledge and creativity..."


Browser Application: loading asset html files

by Mark Murphy » Sat, 14 Feb 2009 06:53:59 GMT


This is correct behavior.

Browser cannot load file:/// URLs in general, let alone from inside the
packaged assets of an arbitrary application that isn't the Browser itself.

A URL of file:///android_asset/popup.htm will work OK for an embedded
WebView, though.

Mark Murphy (a Commons Guy) 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!


Sponsored Links

Browser Application: loading asset html files

by Fred Grott(shareme) » Sat, 14 Feb 2009 07:51:07 GMT

 Komar there i s a tutorial on webview I believe at

If you still need poitners..speak up as there are a few of us webview
adventuers around

On Feb 13, 3:54pm, Kumaravel Kandasami


Other Threads

1. ListView not refreshing on back button when cursor is changed

My user has a menu option to jump from a list activity to a preference
screen which has options for filtering and/or sorting visible data in the
aforementioned list activity. When the user hits the back button, inside
onResume() I am calling cursor.managedQuery() with the new sort/filter
params. The query is executing (with expected sorted results) but the
ListView isn't updating. If I force onCreate to fire by rotating the device,
the list updates appropriately. The only workaround I've found so far is to
re-create the adapter onResume ...which obviously isn't the best approach as
I lose scroll position etc.

I've attempted notify change manually to no avail. (as well as requery - but
the problem isn't data retrieval) I'm sure I'm missing something obvious. :\



2. Android APIs


I'm new in Android! I work with Eclipse and implements some
application using the Android Emulator.

I'd like to know:

1. is it possible to extend Android APIs whit other .jar file?

2. If it's possible, how can I extend the APIs? I just have to add
libraries to the project or do I copy it to the $ANDROID_HOME/

Thanks in advance.



3. How to make a imageview at right of linearlayout

4. Putting a service into a .jar?

5. Add link to my activity in Contact's Phone Number Context Menu

6. build android sdk from git on ubuntu 10.04 fail

7. android build error :, libz.a