package com.xixun.display;

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

/**

 * @Description 功能描述： 该类用来实现该app开机自动运行
 */

public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        MyLog.i("自启动程序即将执行");
//        MyLog.sleepForSecond(5);
        Intent mBootIntent = new Intent(context, MainActivity.class);
	//下面这句话必须加上才能开机自动运行app的界面
        mBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(mBootIntent);
    }
}
