title: Dynamically set the android:noHistory attribute
body: <p>I'm stuck between a rock and a hard place. I am developing an application that shows a welcome page and asks a user to either register or sign in. A user can go to and from registration/sign in activity to main activity (welcome page) by up caret button and a phone's back button. </p>
  
  <p>But once a user logs in or creates an account, I'd like both the main activity (welcome page) and previous activity (could either be login activity or register activity) to be removed from the application's stack so when a user taps a back button, they'd exit the application instead of going back to the activity they came from (either login or registration). 
  I can't set the <code>android:noHistory="true"</code> on registration and sign in activity in <code>AndroidManifest</code> as it'd also mean exiting from the application from that particular activity instead of going back to welcome page. 
  So, how can I dynamically set the <code>noHistory</code> flag on these activities upon reaching a particular activity? Or maybe there's something wrong with the application flow that I have in mind.
  Appreciate your help, thanks!</p>