Android Toolbar Back Button

shape
shape
shape
shape
shape
shape
shape
shape

It’s always convenient to have that little button to “go back” to the previous Activity, and to add it is very simple, just add a directive in your“AndroidManifest.xml“.

 

 

  <activity
            android:name=".BackButtonActivity"
            android:parentActivityName=".MainActivity">
            <!-- Este meta dado é necessário para versões abaixo da 4.1 -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity" />
        </activity>

MainActivity corresponds to the Activity to which the application should return when we click on “return”.

Leave a Reply

Your email address will not be published. Required fields are marked *

Latest news

Latest news directly from our blog.