From 762d7d19a297de75a53b552d655ef2f43c77fc71 Mon Sep 17 00:00:00 2001 From: uykek Date: Sat, 22 Aug 2020 15:20:41 +0200 Subject: [PATCH] Add back button to CreateSudokuActivity --- .../ui/CreateSudokuActivity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java index a8f215d..73e0adc 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/CreateSudokuActivity.java @@ -34,6 +34,7 @@ import android.widget.TextView; import android.widget.Toast; import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; import org.secuso.privacyfriendlysudoku.controller.GameController; import org.secuso.privacyfriendlysudoku.controller.Symbol; @@ -89,6 +90,11 @@ public class CreateSudokuActivity extends BaseActivity implements IFinalizeDialo private void setUpLayout() { setContentView(R.layout.activity_create_sudoku); + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + layout = (SudokuFieldLayout)findViewById(R.id.sudokuLayout); layout.setSettingsAndGame(sharedPref, gameController); @@ -113,6 +119,12 @@ public class CreateSudokuActivity extends BaseActivity implements IFinalizeDialo gameController.notifyHighlightChangedListeners(); } + @Override + public boolean onSupportNavigateUp() { + onBackPressed(); + return true; + } + @Override public void onResume(){ super.onResume();