Skip to content

Commit

Permalink
fix(android): crash with MapView in TabGroup
Browse files Browse the repository at this point in the history
Fixes TIMOB-28501
  • Loading branch information
jquick-axway authored and sgtcoolguy committed Jul 13, 2021
1 parent 3059dab commit 535430c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

0 comments on commit 535430c

Please sign in to comment.