Enable download in Sketchware web browser


Webview download hijack​

Code here:

webview1.setDownloadListener(new DownloadListener() {\n    public void onDownloadStart(String url, String userAgent,\n                String contentDisposition, String mimetype,\n                long contentLength) {\n        Intent i \u003d new Intent(Intent.ACTION_VIEW);\n        i.setData(Uri.parse(url));\n        startActivity(i);\n    }\n});

Comments

  1. how to use this code in android studio...?

    ReplyDelete
  2. This code error in android
    webview1.setDownloadListener(new DownloadListener() {\n public void onDownloadStart(String url, String userAgent,\n String contentDisposition, String mimetype,\n long contentLength) {\n Intent i \u003d new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(url));\n startActivity(i);\n }\n});

    ReplyDelete

Post a Comment

Popular posts from this blog

Play video on Sketchware

How to add calendar in your Android App using Sketchware