From ffc896c0a050165ec6434f2eb2ebd01886d412ee Mon Sep 17 00:00:00 2001
From: RainVisitor <abc873693@gmail.com>
Date: Mon, 18 Feb 2019 19:59:08 +0800
Subject: [PATCH] Restore show logout dialog

---
 .../kuasapmaterial/base/SilentActivity.java   | 43 ++++++++-----------
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/KUAS-AP-Material/app/src/main/java/silent/kuasapmaterial/base/SilentActivity.java b/KUAS-AP-Material/app/src/main/java/silent/kuasapmaterial/base/SilentActivity.java
index 962cb57..e25f103 100644
--- a/KUAS-AP-Material/app/src/main/java/silent/kuasapmaterial/base/SilentActivity.java
+++ b/KUAS-AP-Material/app/src/main/java/silent/kuasapmaterial/base/SilentActivity.java
@@ -409,31 +409,26 @@ public void onBackPressed() {
 		if (drawer != null && navigationView != null && drawer.isDrawerOpen(navigationView)) {
 			drawer.closeDrawers();
 		} else {
-			if (mLayoutID == R.layout.activity_logout) {
-				if (mTracker != null) {
-					mTracker.send(new HitBuilders.EventBuilder().setCategory("logout dialog")
-							.setAction("create").build());
-				}
-				new AlertDialog.Builder(this).setTitle(R.string.app_name)
-						.setMessage(R.string.logout_check).setPositiveButton(R.string.determine,
-						new DialogInterface.OnClickListener() {
-
-							@Override
-							public void onClick(DialogInterface dialog, int which) {
-								if (mTracker != null) {
-									mTracker.send(new HitBuilders.EventBuilder()
-											.setCategory("logout dialog").setAction("click")
-											.build());
-								}
-								clearUserData();
-								Memory.setBoolean(SilentActivity.this, Constant.PREF_AUTO_LOGIN,
-										false);
-								finish();
-							}
-						}).setNegativeButton(R.string.cancel, null).show();
-			} else {
-				super.onBackPressed();
+			if (mTracker != null) {
+				mTracker.send(new HitBuilders.EventBuilder().setCategory("logout dialog")
+						.setAction("create").build());
 			}
+			new AlertDialog.Builder(this).setTitle(R.string.app_name)
+					.setMessage(R.string.logout_check)
+					.setPositiveButton(R.string.determine, new DialogInterface.OnClickListener() {
+
+						@Override
+						public void onClick(DialogInterface dialog, int which) {
+							if (mTracker != null) {
+								mTracker.send(
+										new HitBuilders.EventBuilder().setCategory("logout dialog")
+												.setAction("click").build());
+							}
+							clearUserData();
+							Memory.setBoolean(SilentActivity.this, Constant.PREF_AUTO_LOGIN, false);
+							finish();
+						}
+					}).setNegativeButton(R.string.cancel, null).show();
 		}
 	}