You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/src/main/java/io/neurolab/main/NeuroLab.java
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,8 @@ public class NeuroLab extends AppCompatActivity
82
82
privateMenumenu;
83
83
privateCardViewmeditationCard;
84
84
privateintlauncherSleepTime;
85
+
privatestaticfinalintTIME_INTERVAL = 2000;
86
+
privatelongmBackPressed;
85
87
privateUsbSerialInterface.UsbReadCallbackreadCallback = newUsbSerialInterface.UsbReadCallback() { //Defining a Callback which triggers whenever data is read.
86
88
@Override
87
89
publicvoidonReceivedData(byte[] arg0) {
@@ -269,7 +271,13 @@ public void onBackPressed() {
269
271
drawer.closeDrawer(GravityCompat.START);
270
272
} else {
271
273
unregisterReceiver(broadcastReceiver);
272
-
super.onBackPressed();
274
+
if (mBackPressed + TIME_INTERVAL > System.currentTimeMillis()) {
0 commit comments