Advertisement
ScottHelme

GPS Tracker - BootReceiver

Jul 18th, 2013
247
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.prodev.litetrack;
  2.  
  3. import java.util.Timer;
  4. import java.util.TimerTask;
  5.  
  6. import android.content.BroadcastReceiver;
  7. import android.content.Context;
  8. import android.content.Intent;
  9. import android.util.Log;
  10.  
  11. public class BootReceiver extends BroadcastReceiver {
  12.      
  13.     @Override
  14.       public void onReceive(Context ctx, Intent intent) {
  15.         Log.i("BOOM", "System booted");
  16.         Intent service = new Intent(ctx, MainActivity.class);
  17.         ctx.startService(service);       
  18.       }
  19. }
Advertisement
RAW Paste Data Copied
Advertisement