2016-08-29 1 views
0

スクリーンロックにはいくつかの優れたセキュリティ機構があります。 (ピン、パスワード、パターンなど)
私のAPは、同様のセキュリティ機構を持ちたいと考えています。
画面ロックのセキュリティメカニズムを呼び出すことはできますか?
(ので、私のAPだけで結果を知る必要があり、それ自体でセキュリティを処理する必要はありません)アプリでアンドロイドのセキュリティーメカニズム(ピンコード、パターン、パスワードなど)を使用できますか?

答えて

1

誰かが

//put below source code in where you want to launch password UI 
km = (KeyguardManager) getSystemService(context.KEYGUARD_SERVICE); 
if(km.isKeyguardSecure()) { 
    Intent i = km.createConfirmDeviceCredentialIntent(null, null); 
    activity.startActivityForResult(i, 1234); 
} 

// call back when password is correct 
@Override 
protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
    if (requestCode == 1234) { 
     if (resultCode == RESULT_OK) { 
      //do something you want when pass the security 
     } 
    } 
} 
を参照するために、私は、それを行うための方法を発見しました
関連する問題