title: How to implement getSupportParentActivityIntent() to set the activity dynamically for up-button in android
body: <p>How to know which parent activity calls the child activity in android?</p>
  
  <p>Assume I have three activities A,B and C. A and B are parent activities. C is the child activity. That means C can be started by either from A or B.</p>
  
  <p>So how can I know which parent activity causes to start the child activity?</p>
  
  <p>The problem is I need to set the back button according to that parent intent.For that I want to override <strong>getSupportParentActivityIntent()</strong> method and it needs the intent object to start again the parent activity.</p>
  
  <p><a href="http://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html#getSupportParentActivityIntent%28%29" rel="nofollow">Here is the method description in android site</a></p>
  
  <p>How to get the parent activity to correctly override the getSupportParentActivityIntent() method?</p>
  
  <p>Thanks.</p>