Unable to open an HTML file stored in my device


I have a log file that is being generated and stored in my android device. The log file is stored in .htm format. The file is generated and stored correctly and i am able to view this using device file explorer. When i try to open the file i get the following error.


Unable to open URL!

No Activity found to handle intent {act=android.intent.action.View dat="My file location" flg=0x10000000}

The function that opens the htm file is below:

public static void cmdStartHtmlViewActivity(Uri uri, CharSequence title, boolean isType)
        final Intent intent = new Intent(app.getInstance(), HtmlViewActivity.class);
        intent.putExtra("title", title);
        intent.putExtra("IsFeedContentLink", isType);

Call to the function:

cmdStartHtmlViewActivity(Uri.parse("My File Path", UPDATE_AND_DOWNLOAD_LOG, false);

The above code works on the emulator and displays the file but on a Samsung device i get the error. I have checks in my code to verify if file exists and it shows as it exists.

Any thoughts on why this maybe happening?

asked on Stack Overflow Sep 20, 2019 by Kobe00992 • edited Sep 20, 2019 by Fantômas

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0