package com.example.gmalpha_flutter

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.View
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin
import com.taobao.idlefish.flutterboost.containers.BoostFlutterActivity

import io.flutter.app.FlutterActivity
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import java.lang.ref.WeakReference

class MainActivity : FlutterActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        GeneratedPluginRegistrant.registerWith(this)
//        setContentView(R.layout.activity_main)
//        findViewById<View>(R.id.hello).setOnClickListener {
//            val intent = Intent()
//            intent.putExtra("name","prestige")
//            PageRouter.openPageByUrl(this, PageRouter.FLUTTER_PAGE_URL, intent)
//            startActivity(intent)
//
//        }

        MethodChannel(flutterView, "flutter_bury_channel").setMethodCallHandler { methodCall, result ->
            if (methodCall.method.equals("FLUTTER_TO_H5")) {
                Log.e("lsy","  WQEWQEWQEQW")
                startActivity(Intent(this, Temp::class.java));
            }
        }
    }
}
