1

I am a novice and just to avoid running into difficulties, I created an app with a simple webview function that displays an external site, so that when I have to make a change, I go to the site and update the app as well.

The problem is that if I attach a file on the site (even a simple pdf) from the app it is not possible to download it despite having put the download permissions. Is there a way to "enable" all downloads from the app related to a site domain?

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


    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
Simone
  • 11
  • 2

1 Answers1

0

It seems that you gave the correct permissions in your Manifest, so the issue must be in the Java code. Since you didn't attach it: you should have a webView.setDownloadListener() method. This question is really similar to yours and might be helpful:

Download file inside WebView

Please attach Java code for a more specific answer.

CarlosT
  • 181
  • 1
  • 18