Closed the screen when press back button from App passcode screen

Signed-off-by: Kuuuna98 <yunaghgh@naver.com>
This commit is contained in:
Kuuuna98 2020-11-19 19:22:14 +09:00
parent 4ef7aa90b9
commit ddc3db038c

View file

@ -365,10 +365,13 @@ public class PassCodeActivity extends AppCompatActivity implements Injectable {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event){
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
if(ACTION_CHECK.equals(getIntent().getAction())){
moveTaskToBack(true);
finishAndRemoveTask();
}else if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
finish();
} // else, do nothing, but report that the key was consumed to stay alive
}// else, do nothing, but report that the key was consumed to stay alive
return true;
}
return super.onKeyDown(keyCode, event);