Android automatically runs applications at startup

From , 3 Years ago, written in Java, viewed 221 times.
URL https://pastebin.vip/view/f23b3df7
  1. in AndroidManifest.xml (application-part):
  2.  
  3. <receiver android:enabled="true" android:name=".BootUpReceiver"
  4.         android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
  5.  
  6.         <intent-filter>
  7.                 <action android:name="android.intent.action.BOOT_COMPLETED" />
  8.                 <category android:name="android.intent.category.DEFAULT" />
  9.         </intent-filter>
  10. </receiver>
  11. [..]
  12. <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
  13. [..]
  14.  
  15. public class BootUpReceiver extends BroadcastReceiver{
  16.  
  17.         @Override
  18.         public void onReceive(Context context, Intent intent) {
  19.                 Intent i = new Intent(context, MyActivity.class);  
  20.                 i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  21.                 context.startActivity(i);  
  22.         }
  23.  
  24. }
  25. //java/5503

Reply to "Android automatically runs applications at startup"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website