How to Enable Android Download Manager

前端 未结 4 1790
不思量自难忘°
不思量自难忘° 2020-12-23 14:04

I\'m using Android Download Manager to download list of files. Lately I came across a crash report saying

Unknown java.lang.IllegalArgumentException: Unknown

4条回答
  •  生来不讨喜
    2020-12-23 14:52

    Some folks were looking for an answer to this question and I just realized that the Answer made to this question is somehow deleted. So I want to answer my own question.

    There is no way to activate/deactivate Download Manager directly, since it's system application and we don't have access to it.

    Only alternative left is to redirect the User to the Info Page of Download Manager Application.

    try {
         //Open the specific App Info page:
         Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
         intent.setData(Uri.parse("package:" + "com.android.providers.downloads"));
         startActivity(intent);
    
    } catch ( ActivityNotFoundException e ) {
         e.printStackTrace();
    
         //Open the generic Apps page:
         Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
         startActivity(intent);
    }
    

提交回复
热议问题