skip to main | skip to sidebar

惡龍的家

2018年2月1日 星期四

Check if device is locked

Reference:

https://stackoverflow.com/questions/8317331/detecting-when-screen-is-locked

Code snippet:

KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
boolean isPhoneLocked = keyguardManager.inKeyguardRestrictedInputMode();
張貼者: 輝哲 於 下午4:43
標籤: Android, App

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁
訂閱: 張貼留言 (Atom)

網誌存檔

  • ►  2019 (1)
    • ►  5月 (1)
  • ▼  2018 (15)
    • ►  9月 (1)
    • ►  5月 (1)
    • ►  4月 (5)
    • ►  3月 (1)
    • ▼  2月 (7)
      • Add/Remove Toolbar elevation
      • Difference between removing an app from recent app...
      • Change the color of toolbar overflow icon
      • Change the color of status bar and icon/text
      • Change navigation bar color
      • Check if device is locked
      • Completely transparent status bar and navigation bar
  • ►  2017 (17)
    • ►  12月 (4)
    • ►  11月 (1)
    • ►  9月 (1)
    • ►  8月 (2)
    • ►  7月 (2)
    • ►  6月 (1)
    • ►  5月 (2)
    • ►  3月 (1)
    • ►  2月 (2)
    • ►  1月 (1)
  • ►  2016 (18)
    • ►  6月 (1)
    • ►  5月 (4)
    • ►  4月 (4)
    • ►  3月 (5)
    • ►  1月 (4)
  • ►  2015 (48)
    • ►  12月 (8)
    • ►  11月 (9)
    • ►  10月 (5)
    • ►  9月 (1)
    • ►  8月 (4)
    • ►  7月 (10)
    • ►  6月 (11)

關於我自己

輝哲
檢視我的完整簡介