1

I am making screen lock application. i want to lunch my activity at the time when user unlock the phone by pressing the unlock button. at that time the broadcast receiver will be fired and the lock screen activity will be launched . at that time all the keys like back press key , home key and recent application keys will be disabled. user can even bring the notification panel from top of the screen. to do everything user have to unlock the screen from the app.

I am using SCREEN_ON receiver at the manifest but it is some how not being fired when the screen gets turned on.

i have 2 questions :

  1. I want to start my activity when the user turn on the screen or user unlocks the screen.
  2. I want to keep my activity at the top till the user does not unlock it. till user does not unlock it no other activity or app can come in front of it. even no notification should be shown.

my manifest is :

<receiver
        android:name=".receiver"
        android:enabled="true">
        <intent-filter>
            <action android:name="android.intent.action.SCREEN_ON" />
        </intent-filter>
</receiver>

please suggest any solution.

Sagar Nayak
  • 2,138
  • 2
  • 19
  • 52

1 Answers1

2

Add this filter <action android:name="android.intent.action.USER_PRESENT" />

Surajit Mondal
  • 182
  • 2
  • 8