package com.izouma.mobilecybergames;

import android.content.Intent;
import android.os.Bundle;

import com.mr.flutter.plugin.filepicker.FilePickerPlugin;

import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
    public static final String APP_LIFECYCLE_ACTION = "APP_LIFECYCLE_ACTION";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        GeneratedPluginRegistrant.registerWith(this);
        ScreenStreamPlugin.registerWith(registrarFor("com.izouma.mobilecybergames.ScreenStreamPlugin"));
    }

    @Override
    protected void onResume() {
        super.onResume();
        Intent intent = new Intent();
        intent.setAction(APP_LIFECYCLE_ACTION);
        intent.putExtra("event", "onResume");
        sendBroadcast(intent);
    }

    @Override
    protected void onPause() {
        super.onPause();
        Intent intent = new Intent();
        intent.setAction(APP_LIFECYCLE_ACTION);
        intent.putExtra("event", "onPause");
        sendBroadcast(intent);
    }
}
