3

I need to dismiss my dialog if the android:launchMode is not standard, I need to access this attribute in my code, it is set in the manifest file, I cannot find the solution, anyone can help? Thank you!

newszer
  • 440
  • 1
  • 4
  • 23
  • what do you want to do which depends on launch mode? tell me so that i can help – Jitesh Mohite Feb 15 '17 at 03:09
  • For example I have a dialogFragment shown in the activity, and if the launch mode is standard, Android will create a new window to show another intent, and the dialog should be retained, and if the mode is singleTask, the dialog needs to be dismisses to show another intent content. – newszer Feb 15 '17 at 03:26

3 Answers3

0

in general, if activity launchMode is not standard you open activity it will call onNewIntent, or it will call onCreate. hope it helps you.

jame
  • 122
  • 1
  • 2
  • 14
0

If launch mode is "singleTask" it will come to onNewIntent if you are launching same activity again otherwise for first time it will call onCreate.

you can safely write your code inside onNewIntent

Jitesh Mohite
  • 31,138
  • 12
  • 157
  • 147
0

You can try 'getIntent().getFlags()'

enter image description here

Yat3s
  • 330
  • 1
  • 11