Home > OS >  Back button on action bar
Back button on action bar

Time:09-22

when I create a new activity, Android Studio show me this photo:

enter image description here

It have a Back button but activity haven't it. how can I Make visible it?

CodePudding user response:

put getSupportActionBar().setDisplayHomeAsUpEnabled(true); into onCreate() method in your activity class

CodePudding user response:

In manifest declare the activity as a parent activity to get this button like this

<activity android:name="com.owletogroceries.activity.RewardsActivity"/>

<activity android:name="OrderConfirmationActivity" 
          android:parentActivityName="ProductActivity"/>
  • Related