Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. public class CloseLockerActivity extends BaseActivity {
  2.  
  3. @Override
  4. protected void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(R.layout.activity_close_locker);
  7. getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  8. /** Window flag: when set the window will cause the keyguard to
  9. * be dismissed, only if it is not a secure lock keyguard. Because such
  10. * a keyguard is not needed for security, it will never re-appear if
  11. * the user navigates to another window (in contrast to
  12. * {@link #FLAG_SHOW_WHEN_LOCKED}, which will only temporarily
  13. * hide both secure and non-secure keyguards but ensure they reappear
  14. * when the user moves to another UI that doesn't hide them).
  15. * If the keyguard is currently active and is secure (requires an
  16. * unlock pattern) than the user will still need to confirm it before
  17. * seeing this window, unless {@link #FLAG_SHOW_WHEN_LOCKED} has
  18. * also been set.
  19. *
  20. * public static final int FLAG_DISMISS_KEYGUARD = 0x00400000;
  21. */
  22. getWindow().addFlags((WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD));
  23. MainHandler.getInstance().postDelayed(this::finish, 1000);
  24. }
  25.  
  26. public static void open(Context context) {
  27. Intent intent = new Intent(context, CloseLockerActivity.class);
  28. intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  29. context.startActivity(intent);
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement