title: Is there any way to know if an activity has a parent activity or not?
body: <p>Upon clicking a button in an activity, I want to display Page1 if this activity has a parent activity and display Page2 if it does not (i.e. it is the Main Activity that is started when I started the application). </p>
  
  <ol>
  <li>Is there any way to know if an activity has a parent activity or not?</li>
  <li>I tried getIntent() from the main but it doesn't crash. What does getIntent() return if I call it on the very first activity??
  Edit: it crashes when I call getIntent() in OnCreate, but doesn't crash if I call it in a method that is called when I press a button.</li>
  </ol>