IS there any way to open our app in android when anyone unlocks the screen -
I want to open my app every time my user opens the home screen. Please help me This app is for my personal use so any help would be great
thanks
Register your application Get the intent of SCREEN_ON by entering a receiver in your manifest: Write the receiver category to unlock the screen and to get the intent to run the desired activity: *
& lt; Receiver Android: name = ". ReceiverScreenUnlocked" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.SCREEN_ON" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; / Application & gt;
public Class receiver expands the unblock broadcast receiver screen {@ override public resumption at zero (reference reference, intention intent) {intent i = new intent (); I.setClassName ("com.test", "com.test.MainActivity"); I.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK); Context.startActivity (i); }}
Comments
Post a Comment