2
I am trying to Block the Screen with the following code:
protected void onBloquear(View view) {
DevicePolicyManager mDPM = null;
mDPM.lockNow();
}
Source: https://developer.android.com/guide/topics/admin/device-admin.html
But it makes the following mistake.
Caused by: java.lang.NullPointerException:
Attempt to invoke virtual method 'void android.app.admin.DevicePolicyManager.lockNow()'
on a null object reference
Does anyone have any idea what it might be?