I\'m trying to send intent to browser to open local file. I wish to use default browser to open this file.
if(file.exists()){
Log.d(TAG, \"file.exists\");
This code works on both API 10 and API 11.
File f = new File("/mnt/sdcard/index.html");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setDataAndType(Uri.fromFile(f), "application/x-webarchive-xml");
// Have to add this one in order to work on Target 2.3.3 (API 10)
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);