android:fix runtime error
This commit is contained in:
parent
0516ad0f5a
commit
e7ddcd1b67
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package pub.doric.plugin;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@ -53,6 +55,12 @@ public class ShaderPlugin extends DoricJavaPlugin {
|
||||
getDoricContext().getDriver().asyncCall(new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
if (getDoricContext().getContext() instanceof Activity) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1
|
||||
&& ((Activity) getDoricContext().getContext()).isDestroyed()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
String viewId = jsObject.getProperty("id").asString().value();
|
||||
RootNode rootNode = getDoricContext().getRootNode();
|
||||
if (TextUtils.isEmpty(rootNode.getId())) {
|
||||
|
@ -18,6 +18,7 @@ package pub.doric.shader;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import pub.doric.DoricContext;
|
||||
import pub.doric.utils.DoricLog;
|
||||
|
||||
import com.github.pengfeizhou.jscore.JSArray;
|
||||
import com.github.pengfeizhou.jscore.JSObject;
|
||||
@ -61,6 +62,10 @@ public abstract class GroupNode<F extends ViewGroup> extends SuperNode<F> {
|
||||
for (int idx = 0; idx < mChildViewIds.size(); idx++) {
|
||||
String id = mChildViewIds.get(idx);
|
||||
JSObject model = getSubModel(id);
|
||||
if (model == null) {
|
||||
DoricLog.e("configChildNode error when Group is %s and child is %s", this.getId(), id);
|
||||
continue;
|
||||
}
|
||||
String type = model.getProperty("type").asString().value();
|
||||
if (idx < mChildNodes.size()) {
|
||||
ViewNode oldNode = mChildNodes.get(idx);
|
||||
|
Reference in New Issue
Block a user