Senin, 05 Februari 2018

set your back up button on your aplikation to back to return to the previous activity

you can use my code.
first code you can use in your manifest
add this code on your atribute activity:

<activity
    android:name=".Activity2"
    android:theme="@style/AppTheme"
    android:label="@string/tes">
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value=".MainActivity" />
</activity>
second code you can use this code in your activity
@Overridepublic boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == android.R.id.home) {
        onBackPressed();
        }
return super.onOptionsItemSelected(item);
}
have fun to coding



Tidak ada komentar:

how to update playonlinux? || bagaimana update playonlinux di linux mint

open terminal wget -q "http://deb.playonlinux.com/public.gpg" -O - | sudo apt-key add - sudo wget http://deb.playonlinux.com/pla...