package com.handset.serialportsensor;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.handset.serialportsensor.activity.Main2Activity;
import com.handset.serialportsensor.utils.Slog;


public class BootReceiver extends BroadcastReceiver {

    private final String TAG = getClass().getSimpleName();

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
            Slog.d(TAG, "Receive Broadcast");
            Intent bootIntent = new Intent(context, Main2Activity.class);
            bootIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(bootIntent);
        }
    }
}
