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:

  & 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;   

Write the receiver category to unlock the screen and to get the intent to run the desired activity:

  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

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -