package com.hw.nativeapp.ui.receiver;

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

import com.hw.nativeapp.ui.activity.SplashActivity;

public class BootBroadcastReceiver extends BroadcastReceiver {
    static final String ACTION = "android.intent.action.BOOT_COMPLETED";


    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(ACTION)) {
            Intent bootMainIntent = new Intent(context, SplashActivity.class);
            // 这里必须为FLAG_ACTIVITY_NEW_TASK
            bootMainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(bootMainIntent);
        }
    }
}
