user3382499
user3382499

Reputation: 188

Intent.createChooser got java.lang.SecurityException

I encountered a problem. This is my code

Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);

intent = Intent.createChooser(intent, "Pick");

startActivity(intent, 0);

But I got

java.lang.RuntimeException: Unable to start activity ComponentInfo{android/com.android.internal.app.ChooserActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.PICK dat=content://media/external/video/media flg=0x3000000 cmp=com.android.music/.VideoBrowserActivity }

on many android devices.

I try to catch this exception via

try{
startActivity(intent, 0);
}catch(Exception ex){
//nothing to do
}

But it didn't work.

How can I catch this Exception to make my App not crash?

Upvotes: 0

Views: 355

Answers (1)

Boyi
Boyi

Reputation: 120

I'm also encounter the similar issues, and I afraid that it couldn't be solved. so... maybe you can send the report or try another environment such as iOS.

Upvotes: 1

Related Questions