From 38a84e0f1e5a0918757aaf70a951d13f91ee1e1d Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Mon, 4 Jun 2018 02:02:55 +0200 Subject: [PATCH] Fix fragment glitch when using the back button --- .../java/com/herbron/moodl/Activities/HomeActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java b/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java index c8f26c8..7758bba 100644 --- a/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java +++ b/app/src/main/java/com/herbron/moodl/Activities/HomeActivity.java @@ -8,8 +8,10 @@ import android.support.design.widget.NavigationView; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; +import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.Window; @@ -103,10 +105,11 @@ public class HomeActivity extends AppCompatActivity { }); setupBalanceSwitch(); + } - //Objects initialization - - //Layouts setup + @Override + public void onBackPressed() { + drawerLayout.openDrawer(GravityCompat.START); } public void setListener(HideBalanceSwitch switchInterface)