File tree 1 file changed +10
-0
lines changed
utilcode/src/main/java/com/blankj/utilcode/util
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 12
12
import android .support .annotation .RequiresApi ;
13
13
import android .support .v4 .content .ContextCompat ;
14
14
import android .util .Log ;
15
+ import android .view .MotionEvent ;
16
+ import android .view .WindowManager ;
15
17
16
18
import com .blankj .utilcode .constant .PermissionConstants ;
17
19
import com .blankj .utilcode .util .PermissionUtils .OnRationaleListener .ShouldRequest ;
@@ -288,6 +290,8 @@ public static void start(final Context context) {
288
290
289
291
@ Override
290
292
protected void onCreate (@ Nullable Bundle savedInstanceState ) {
293
+ getWindow ().addFlags (WindowManager .LayoutParams .FLAG_NOT_TOUCHABLE
294
+ | WindowManager .LayoutParams .FLAG_WATCH_OUTSIDE_TOUCH );
291
295
if (sInstance == null ) {
292
296
super .onCreate (savedInstanceState );
293
297
Log .e ("PermissionUtils" , "request permissions failed" );
@@ -320,6 +324,12 @@ public void onRequestPermissionsResult(int requestCode,
320
324
sInstance .onRequestPermissionsResult (this );
321
325
finish ();
322
326
}
327
+
328
+ @ Override
329
+ public boolean dispatchTouchEvent (MotionEvent ev ) {
330
+ finish ();
331
+ return true ;
332
+ }
323
333
}
324
334
325
335
You can’t perform that action at this time.
0 commit comments