How do I open android built in downloads app?
- by user1502829
So I'm downloading stuff and it gets put into the built in downloads app since thats how the download manager works. I just want to the user to click a button which opens the built in downloads app.
Heres my try:
btnDownloads.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v) {
PackageManager pakMan=MainActivity.context.getPackageManager();
Log.d("bebr", "Making pak");
if(pakMan!=null){
Intent downloadsIntent=new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER).setComponent(new ComponentName("com.android.downloads","com.android.downlods.Downloads"));
ResolveInfo resolved=pakMan.resolveActivity(downloadsIntent, PackageManager.MATCH_DEFAULT_ONLY);
Log.d("bebr","Resolving");
if(resolved!=null){
Log.d("bebr", "Starting");
startActivity(downloadsIntent);
}
}
}
});