How to remove the back button on android

1

How do I remove this back button from my application?

    
asked by anonymous 13.10.2015 / 01:27

1 answer

1

If you are in oncreate, the code below will drop you.

getSupportActionBar().setDisplayHomeAsUpEnabled(true);

You should also take ParentAcivity in androidmanifest.xml. ex:

<activity
        android:name=".activity.Telefones"
        android:label="@string/title_activity_mostrar_telefones"
        android:parentActivityName=".activity.ListaTelefones">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="br.com.dtec.listatelefonica2.activity.ListaTelefones" />
    </activity>

Leave only:

<activity
        android:name=".activity.MostrarTelefones"
        android:label="@string/title_activity_mostrar_telefones"
        >
</activity>

By removing these codes, Up Navigation will quit

    
13.10.2015 / 01:47