From 0d56efc232027d937d05cd179ea0557313ceac83 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 25 Jan 2016 22:46:26 +0100 Subject: [PATCH] Don't close app when pressing app icon in main activity. --- .../scala/com/nutomic/ensichat/activities/MainActivity.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/scala/com/nutomic/ensichat/activities/MainActivity.scala b/android/src/main/scala/com/nutomic/ensichat/activities/MainActivity.scala index 9ed2093..f3b9e8d 100644 --- a/android/src/main/scala/com/nutomic/ensichat/activities/MainActivity.scala +++ b/android/src/main/scala/com/nutomic/ensichat/activities/MainActivity.scala @@ -126,7 +126,8 @@ class MainActivity extends EnsichatActivity { override def onOptionsItemSelected(item: MenuItem): Boolean = item.getItemId match { case android.R.id.home => - onBackPressed() + if (currentChat.isDefined) + onBackPressed() true; case _ => super.onOptionsItemSelected(item);