Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): crash with MapView in TabGroup as of 10.0.1 #12932

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public View getContentView()
// In order for the 'activity' property to work correctly
// we need to set the content view's activity to that of the group.
Activity tabGroupActivity = ((TabProxy) proxy).getTabGroup().getActivity();
proxy.setActivity(tabGroupActivity);
windowProxy.setActivity(tabGroupActivity);

// Assign parent so events bubble up correctly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,8 @@ protected TiUIView handleGetView()
Log.d(TAG, "getView: " + getClass().getSimpleName(), Log.DEBUG_MODE);
}

TiViewProxy parentProxy = getParent();
Activity parentActivity = (parentProxy != null) ? parentProxy.getActivity() : null;

Activity lastActivity = getActivity();
Activity activity = (parentActivity != null) ? parentActivity : lastActivity;
Activity activity = lastActivity;
TiBaseActivity baseActivity = null;

if (activity instanceof TiBaseActivity) {
Expand All @@ -460,9 +457,13 @@ protected TiUIView handleGetView()
activity = baseActivity;

} else if (activity == null) {
if (parentActivity != null) {
activity = parentActivity;
} else {
for (TiViewProxy parent = getParent(); parent != null; parent = parent.getParent()) {
activity = parent.getActivity();
if (activity != null) {
break;
}
}
if (activity == null) {
activity = TiApplication.getAppRootOrCurrentActivity();
}
}
Expand Down