skip to Main Content

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?

2

Answers


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

    Login or Signup to reply.
  2. 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"/>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search