From 49ea547003dc05a002866641740ac6b37cba31a8 Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 22 Feb 2016 10:19:15 +0100 Subject: [PATCH] Use toolbar as action bar --- .../org/solovyev/android/calculator/ActivityUi.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java index c55fb913..44bf106c 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java @@ -182,14 +182,10 @@ public class ActivityUi { if (activity instanceof CalculatorActivity) { return; } - toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha); - toolbar.setNavigationOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - activity.onBackPressed(); - } - }); - toolbar.setTitle(activity.getTitle()); + activity.setSupportActionBar(toolbar); + final ActionBar actionBar = activity.getSupportActionBar(); + Check.isNotNull(actionBar); + actionBar.setDisplayHomeAsUpEnabled(true); } public void restoreSavedTab() {