Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I have finally found.<br> I will try to explain the difference in the behavior clearly:</p> <ol> <li><p>Old behavior:</p> <ul> <li>Launch application</li> <li>Google maps activity starts</li> <li>User accepts redirection to the setting menu to activate GPS</li> <li>Setting menu displayed</li> <li>User click on "Home" button</li> <li>User relaunch the application => the setting menu is displayed, as it is the latest intent in the history stack of the application.</li> </ul></li> </ol> <p>The code to launch this intent was:</p> <pre><code>startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0); </code></pre> <ol> <li><p>New behavior:</p> <ul> <li>Launch application</li> <li>Google maps activity starts</li> <li>User accepts redirection to the setting menu to activate GPS</li> <li>Setting menu displayed</li> <li>User click on "Home" button</li> <li>User relaunch the application => The Google maps is displayed, and not the setting menu, because I have added the flag FLAG_ACTIVITY_NO_HISTORY to the redirection intent.</li> </ul></li> </ol> <p>My code is now:</p> <pre><code>Intent intentRedirectionGPSSettings = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); intentRedirectionGPSSettings.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); startActivityForResult(intentRedirectionGPSSettings, 0); </code></pre> <p>I tried to explain well. The tag "android:noHistory(true)" in the manifest.xml works for activities, but the flag FLAG_ACTIVITY_NO_HISTORY is a good alternative, as it works for intents.</p> <p>Thank you for help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload