I want to start service only when device is unlocked. I've tried this code but it didn't work.Can somebody explain me what do I do wrong?And what should I do?
if( myKM.isKeyguardLocked()==false) {
startService(intent);
Log.i("Point ","5");
} else {
Log.i("Point ","6");
stopService(intent);
}