0

I have a webview in my app; I added a JavascriptInterface for that. In JavaScript interface implementation I have a method for opening URL in new intent but I received an ActivityNotFoundException

@JavascriptInterface
    public void openUrl(String url) {
        try
        {         
          Intent localIntent = new Intent("android.intent.action.VIEW");
          localIntent.addFlags(268435456);
          localIntent.setData(Uri.parse(url));
          Context.startActivity(localIntent);         
          return;
        }
        catch (Exception localException)
        {

        }

    }

The given error is:

exception while trying to open intent: http://google.com
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.com flg=0x10000000 pkg=null }

Any ideas as to what the problem is?

Cartier
  • 429
  • 4
  • 15
mohsen barati
  • 73
  • 2
  • 8

0 Answers0