|
@@ -1,6 +1,18 @@
|
1
|
1
|
package com.reactnativenavigation.playground;
|
2
|
2
|
|
3
|
|
-import com.reactnativenavigation.*;
|
|
3
|
+import android.content.Intent;
|
|
4
|
+
|
|
5
|
+import com.reactnativenavigation.NavigationActivity;
|
4
|
6
|
|
5
|
7
|
public class MainActivity extends NavigationActivity {
|
|
8
|
+ @Override
|
|
9
|
+ public void onWindowFocusChanged(boolean hasFocus) {
|
|
10
|
+ dismissSystemAlertsToPreventDetoxFromTimingOut(hasFocus);
|
|
11
|
+ }
|
|
12
|
+
|
|
13
|
+ private void dismissSystemAlertsToPreventDetoxFromTimingOut(boolean hasFocus) {
|
|
14
|
+ if (! hasFocus) {
|
|
15
|
+ sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
|
|
16
|
+ }
|
|
17
|
+ }
|
6
|
18
|
}
|