2021SC@SDUSC
Hippy项目源码分析第十二周
examples/android-demo/java
MyActivityTiny.java
@SuppressWarnings({
"unused"})
public class MyActivityTiny extends Activity
{
private HippyEngine mHippyEngine;
private HippyRootView mHippyView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
// 1/3. 初始化hippy引擎
{
HippyEngine.EngineInitParams initParams = new HippyEngine.EngineInitParams();
// 必须:hippy运行环境的context。
// 若存在多个Activity加载多个业务jsbundle的情况,则这里初始化引擎时建议使用Application的Context
initParams.context = this;
// 必须:图片加载器
initParams.imageLoader = new HippyImageLoader()
{
// 网络图片加载,异步加载
@Override
public void fetchImage(final String url, final Callback requestCallback, Object param)
{
//noinspection unchecked,rawtypes
Glide.with(MyActivityTiny.this).load(url).