diff options
-rw-r--r-- | app/src/main/java/me/texx/Texx/MainActivity.kt | 3 | ||||
-rw-r--r-- | app/src/main/java/me/texx/Texx/RoutingActivity.kt | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/src/main/java/me/texx/Texx/MainActivity.kt b/app/src/main/java/me/texx/Texx/MainActivity.kt index e428708..8473efa 100644 --- a/app/src/main/java/me/texx/Texx/MainActivity.kt +++ b/app/src/main/java/me/texx/Texx/MainActivity.kt @@ -28,8 +28,9 @@ class MainActivity : AppCompatActivity() { if (intent.getBooleanExtra("serverDown", false)) { alert("We are sorry, but our servers do not seem to be working at the moment. Please wait a few minutes before you try again.", "Sorry") { + isCancelable = false positiveButton("Okay") { - finishAffinity() // TODO: Loading activity will somehow still be opened after close + finishAndRemoveTask() System.exit(0) } }.show() diff --git a/app/src/main/java/me/texx/Texx/RoutingActivity.kt b/app/src/main/java/me/texx/Texx/RoutingActivity.kt index 5ee27a9..168d072 100644 --- a/app/src/main/java/me/texx/Texx/RoutingActivity.kt +++ b/app/src/main/java/me/texx/Texx/RoutingActivity.kt @@ -9,8 +9,7 @@ import com.madapps.prefrences.EasyPrefrences import daio.io.dresscode.dressCodeName import daio.io.dresscode.matchDressCode import me.texx.Texx.util.ThemeUtil.getThemeName -import org.jetbrains.anko.alert -import org.jetbrains.anko.startActivity +import org.jetbrains.anko.* import java.io.IOException /** @@ -51,7 +50,7 @@ class RoutingActivity : AppCompatActivity() { response.httpStatusCode == 200 -> startActivity<MainActivity>() response.httpStatusCode == 401 -> startActivity<LoginActivity>() !isConnected() -> startActivity<MainActivity>("notConnected" to true) - serverError != null -> startActivity<MainActivity>("serverDown" to true) + serverError != null -> startActivity(intentFor<MainActivity>("serverDown" to true).newTask().clearTask().noAnimation().excludeFromRecents()) else -> startActivity<LoginActivity>() } } |