From 5d1362f385430476d20c74c56dd192d17e27eaa2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 8 Apr 2024 10:37:20 +0200 Subject: [PATCH] fix back button in AboutActivity --- .../eu/siacs/conversations/ui/AboutActivity.java | 2 +- .../conversations/ui/ActionBarActivity.java | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/AboutActivity.java b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java index 85c1cdbb1..bcbfdef00 100644 --- a/src/main/java/eu/siacs/conversations/ui/AboutActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java @@ -9,7 +9,7 @@ import androidx.databinding.DataBindingUtil; import eu.siacs.conversations.R; import eu.siacs.conversations.databinding.ActivityAboutBinding; -public class AboutActivity extends BaseActivity { +public class AboutActivity extends ActionBarActivity { @Override diff --git a/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java b/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java index 92f93e539..42c5981c2 100644 --- a/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java @@ -1,12 +1,8 @@ package eu.siacs.conversations.ui; import android.view.MenuItem; -import android.view.View; import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; - public abstract class ActionBarActivity extends BaseActivity { public static void configureActionBar(ActionBar actionBar) { @@ -20,17 +16,11 @@ public abstract class ActionBarActivity extends BaseActivity { } } - public void setSupportActionBar(View toolbar) { - super.setSupportActionBar((Toolbar) toolbar); - } - @Override public boolean onOptionsItemSelected(final MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - finish(); - break; + if (item.getItemId() == android.R.id.home) { + finish(); } return super.onOptionsItemSelected(item); } -} \ No newline at end of file +}