0

I'm using webview to make android apps. All works ok with my page but a have some files in assets I want the users can save from the page. I try to give some permitions for my app:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

and my MainActivity.java have this code:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    WebView web= (WebView)findViewById(R.id.dweb);
    web.getSettings().setJavaScriptEnabled(true);
    web.loadUrl("file:///android_asset/index.html");}

So, I have a link from my html file in assets wish point to the file I want the user download, but the web allways shows an error such as the file don't exist or something

Rahul Chokshi
  • 670
  • 4
  • 18

0 Answers0