package com.ez.ertc.meeting.ui;

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

import com.ez.ertc.meeting.ErtcEzmHelper;
import com.ez.ertc.meeting.base.YsBaseActivity;

import butterknife.ButterKnife;

/**
 * @author xiezuoyuan
 * 用于将主app唤置前台
 * @time 2019/8/30 10:54
 */
public class AirActivity extends YsBaseActivity {

    public static void start(Context context) {
        Intent starter = new Intent(context, AirActivity.class);
        context.startActivity(starter);
    }

    /**
     * 这种启动方式是让此activity从app的主task内启动，达到切换task回到主app的目的
     */
    public static void startFromHost() {
        if (ErtcEzmHelper.getContext() == null){
            return;
        }
        Intent starter = new Intent(ErtcEzmHelper.getContext(), AirActivity.class);
        starter.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        ErtcEzmHelper.getContext().startActivity(starter);
    }

    @Override
    protected int provideLayoutId() {
        return 0;
    }

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }

    @Override
    protected void initData() {
        finish();
    }

    @Override
    protected void onResume() {
        super.onResume();
        //此activity不会走onResume，不用担心泄漏
        YsBaseActivity.TOP_ACTIVITY = null;
    }
}
