Commit fac50819 authored by LuK1337's avatar LuK1337

Jelly: Set proper mime type when downloading files

Change-Id: I3f814e0540b99c189af2d16e8e5d1955e1f9213f
parent 243233e9
......@@ -74,6 +74,7 @@ import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.webkit.MimeTypeMap;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
......@@ -522,6 +523,8 @@ public class MainActivity extends WebViewExtActivity implements
request.setNotificationVisibility(
DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
request.setMimeType(MimeTypeMap.getSingleton().getMimeTypeFromExtension(
MimeTypeMap.getFileExtensionFromUrl(url)));
getSystemService(DownloadManager.class).enqueue(request);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment