Is there an intent “Invalid password when locking the screen”?

I am looking for a way to get a notification if the user enters the wrong password on the Android lock screen (the system lock screen is not a lock screen in my own application). Is there an intention that is dismissed in this situation?

Thanks a lot at advace.

+3
source share
2 answers

I am looking for a way to get a notification if the user enters the wrong password on the Android lock screen (the system lock screen is not a lock screen in my own application). Is there an intention that is dismissed in this situation?

If you have implemented the DeviceAdminReceiverdevice administrator using the APIs, it will be called from onPasswordFailed().

+3
source

You can create your own dialog box in an Android application to display an error message. Below is the code for this:

AlertDialog alertDialog = new AlertDialog.Builder(LoginActivity.this).create();
                        // Setting Dialog Title
                        alertDialog.setTitle("Error");
                        // Setting Dialog Message
                        alertDialog.setMessage("Not A User");
                        // Setting Icon to Dialog
                        alertDialog.setIcon(R.drawable.inputerror);
                        // Setting OK Button
                        alertDialog.setButton("OK",new DialogInterface.OnClickListener() 
                        {
                            public void onClick(DialogInterface dialog, int which) 
                            {
                                // Write your code here to execute after dialog
                                // closed
                                Toast.makeText(getApplicationContext(),"Not A Valid User", Toast.LENGTH_SHORT).show();
                            }
                        });
                        // Showing Alert Message
                        alertDialog.show();
                        return;
-5
source

All Articles