1

I want to use ActivityOptions but When I try to run my application I am getting a security exception as

Permission Denial:starting Intent.

ActivityOptions options = ActivityOptions.makeBasic();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    options.setLaunchDisplayId(1);        
}
Intent secondIntent = new Intent(HomeActivity.this, TestActivity.class);
secondIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(secondIntent, options.toBundle());

Does anyone know what can i do for this?

Kanzariya Hitesh
  • 118
  • 1
  • 15
Captain
  • 11
  • 1
  • Please post full error log – Rohit5k2 Jan 03 '20 at 07:53
  • 1
    Does this answer your question? [Android: java.lang.SecurityException: Permission Denial: start Intent](https://stackoverflow.com/questions/4162447/android-java-lang-securityexception-permission-denial-start-intent) – Bruno Jan 03 '20 at 07:58

0 Answers0