Commit 8261cbe7 by 徐健

backup

parent 759c4e7c
......@@ -4,7 +4,10 @@ package com.ydl.component.base;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import com.channel.ydl_flutter_base.base.BaseFlutterActivity;
import com.channel.ydl_flutter_base.plugin.YDLCommonPlugin;
import com.ydl.devicesidlib.DeviceIDHelper;
import com.ydl.media.audio.PlayService;
import com.ydl.ydlcommon.base.delegate.IAppLifecycles;
......@@ -13,7 +16,17 @@ import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.TimeUnit;
import io.flutter.app.FlutterActivityDelegate;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.view.FlutterMain;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* Created by haorui on 2019-09-02.
......@@ -36,6 +49,12 @@ public class DemoAppLifecycles implements IAppLifecycles {
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(application);
// FlutterMain.ensureInitializationComplete(application, null);
//
// FlutterEngine flutterEngine = new FlutterEngine(application);
// flutterEngine.getDartExecutor().executeDartEntrypoint(DartExecutor.DartEntrypoint.createDefault());
// YDLCommonPlugin plugin = new YDLCommonPlugin();
// flutterEngine.getLocalizationChannel().channel.setMethodCallHandler(plugin);
Intent intent = new Intent(application, PlayService.class);
application.startService(intent);
......@@ -45,6 +64,5 @@ public class DemoAppLifecycles implements IAppLifecycles {
@Override
public void onTerminate(@NotNull Application application) {
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.RxDeviceTool
import io.flutter.app.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.view.FlutterView
......@@ -17,6 +18,8 @@ import io.flutter.view.FlutterView
*/
class YDLCommonPlugin : MethodChannel.MethodCallHandler {
constructor()
private var mActivity: FlutterActivity? = null
private constructor(activity: FlutterActivity) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment