Is there any one that can help me with a code to set a password to lock the screen ? thx
Android N is not working , See Here
Note: This API has been limited as of N for device admins that are not device owner and not profile owner. The password can now only be changed if there is currently no password set. Device owner and profile owner can still do this when user is unlocked and does not have a managed profile.