Switch off noHistory="true" programmatically

29 Views Asked by At

I have a splash activity which has noHistory="true" set in Manifest.xml. In the Activity, I show an information text where the user can click to a link which launch a CustomTabIntent. When I go back here, the app closes (I assume because of noHistory="true"). How I can set the noHistory to false in code, so that it returns to the splash activity in this case?

1

There are 1 best solutions below

0
David Wasser On

You can't "unset" noHistory, and wanting to do that is kinda weird. Normally a splash screen is shown while the app is initializing and then this dismisses itself and launches the real first page of the app. In your case, you are showing the splash screen but also giving the opportunity for the user to show something else. This is counter-intuitive and not how splash screens are designed. Also, a custom tab can be minimized and normally this would show the underlying Activity (in your case the splash screen) and the user can interact with it. This is also in conflict with the fact that splash screens generally show for a short period of time and then dismiss themselves. You should rethink your architecture.