android - BroadcastReceiver onReceive is not getting called -


i have defined broadcastreceiver in androidmanifest.xml below

<receiver    android:name="com.example.hello.screenunlockreceiver"     android:enabled="true"     android:singleuser="true">    <intent-filter>       <action android:name="android.content.intent.action_user_present" />    </intent-filter> </receiver> 

and defined receiver below :

public class screenunlockreceiver        extends broadcastreceiver {      @override    public void onreceive(context context, intent intent) {        //start activity        intent = new intent();        i.setclassname("com.example.hello", "loginactivity");        i.setflags(intent.flag_activity_new_task);        context.startactivity(i);    } } 

but broadcastreceiver not triggered when unlock screen , loginactivity not being shown. loginactivity default loginactivity comes android sdk.

am missing in uses-permission or else, please let me know. thanks

santhosh

the action have intercept is:

<intent-filter>   <action android:name="android.intent.action.user_present" /> </intent-filter> 

developer android action_user_present


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -