CommonReactNativeActivity.java
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.drp.util.react;
import android.os.Bundle;
import com.drp.mobliemall.app.GlobalContext;
import com.drp.util.react.preloadreact.PreLoadReactActivity;
import javax.annotation.Nullable;
/**
* Created on 2017-08-22.
*
* @author 吕浩
* @since 1.0.0
*/
public class CommonReactNativeActivity extends PreLoadReactActivity {
/**
* RN模块名称
*/
public String componentName;
/**
* RN模块版本号
*/
public String version;
/**
* JSBundle路径
*/
public String path;
@Override
protected void onCreate(Bundle savedInstanceState) {
GlobalContext.getInstance().setActivity(this);
this.componentName = getIntent().getStringExtra("componentName");
this.path = getIntent().getStringExtra("path");
this.version = getIntent().getStringExtra("version");
super.onCreate(savedInstanceState);
}
@Nullable
@Override
protected String getMainComponentName() {
return componentName;
}
@Override
protected String getJSBundleFile() {
return path;
}
@Nullable
@Override
protected String getJSBundleVersion() {
return version;
}
}