]> git.ktnx.net Git - mobile-ledger.git/commitdiff
exit when the Exit drawer item is clicked
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 27 Nov 2018 21:09:17 +0000 (21:09 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 27 Nov 2018 21:09:17 +0000 (21:09 +0000)
app/src/main/java/net/ktnx/mobileledger/LatestTransactions.java
app/src/main/res/layout/drawer.xml

index f8c70604c99b5c2f6c1dfce45b9aeca672fcba6f..111b71e9f6ddceb36249116ac245a8cc7224ce95 100644 (file)
@@ -10,6 +10,7 @@ import android.support.v4.widget.DrawerLayout;
 import android.support.v7.app.ActionBarDrawerToggle;
 import android.support.v7.app.AppCompatActivity;
 import android.support.v7.widget.Toolbar;
+import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
@@ -52,6 +53,11 @@ public class LatestTransactions extends AppCompatActivity
         }
     }
 
+    public void nav_exit_clicked(View view) {
+        Log.w("mobileledger", "exiting");
+        finish();
+    }
+
     @Override
     public void onBackPressed() {
         DrawerLayout drawer = findViewById(R.id.drawer_layout);
index b8f069ff2a8493f8bdb7fe6fac3f4d59299d44fb..1f03cfc3e6d903d832a233a4ee65edd444a6afff 100644 (file)
             android:text="@string/action_settings" />
 
         <TextView
-            android:id="@+id/textView3"
+            android:id="@+id/nav_exit"
             style="@style/nav_button"
             android:layout_weight="1"
             android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
+            android:onClick="nav_exit_clicked"
             android:text="@string/nav_exit_title" />
 
     </LinearLayout>