package com.genlot.ninglottery.application;

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

import com.genlot.ninglottery.module.login.LoginActivity;

public class AppBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals("android.intent.action.BEFORE_LAUNCHER_RUN")) {
            Intent bootIntent = new Intent(context, LoginActivity.class);
            bootIntent.setAction("android.intent.action.MAIN");
            bootIntent.addCategory("android.intent.category.LAUNCHER");
            bootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(bootIntent);
        }
    }
}
