From a2299fe8eddcbf5577a1576f899ddc28c8df00d5 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 14 May 2020 11:16:43 +0300 Subject: [PATCH] make the "home" (back arrow) toolbar button in the profile detail activity behave like the back key this already done for the new transaction activity and seems proper here too without it, pressing back (on the "keyboard") finishes the activity returning to the main activity without changing its state (e.g. the drawer is kept open), while pressing the home arrow (usually at the top left) re-starts the main activity, closing its drawer --- .../ui/activity/ProfileDetailActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java index 323568b4..7daa3d31 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java @@ -19,6 +19,7 @@ package net.ktnx.mobileledger.ui.activity; import android.os.Bundle; import android.view.Menu; +import android.view.MenuItem; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; @@ -110,5 +111,12 @@ public class ProfileDetailActivity extends CrashReportingActivity { return true; } - + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } } -- 2.39.5