public class mReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Log.d("tag", "boot ok"); Intent i = new Intent(context, sampleActivity.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } } }Need Uses Permission : android.permission.RECEIVE_BOOT_COMPLETED
No comments:
Post a Comment