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");
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
context.startActivity(intent);
}
But it throws me and exeption
08-10 13:27:58.993: ERROR/AndroidRuntime(28453): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:///sdcard/release_notes.htm }
If I use following intent browser opens google.com as expected
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://google.com"));
Also when I write the file url (file:///sdcard/release_notes.htm) to browser address bar it opens it as expected.
You need to add browsable category in the intent.