Unable to open an HTML file stored in my device

0

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.

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.setData(uri);
        intent.putExtra("title", title);
        intent.putExtra("IsFeedContentLink", isType);
        startActivity(intent);
    }

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?

android
android-intent
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