This is working for me.. Suppose there are two activity (Activityone,Activitytwo)
Inside Activitytwo use this code
@Override
protected void onCreate(Bundle savedInstanceState) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
On Activityone
//when you need to go second activity
startActivity(new Intent(Activityone.this, Activitytwo.class));
This should be included in second activity inside manifest file
<activity android:name=".Activitytwo"
android:parentActivityName=".Activityone"></activity>
And The result would be like this