Skip to content

Commit

Permalink
[TIMOB-26161] Allow activity events on UI thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Jun 27, 2018
1 parent 37f0558 commit 21ab9e8
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1177,13 +1177,16 @@ private void dispatchCallback(final String name, KrollDict data)
data.put("source", activityProxy);

final KrollDict d = data;
runOnUiThread(new Runnable() {
@Override
public void run()
{
activityProxy.callPropertySync(name, new Object[] { d });
}
});
if (TiApplication.isUIThread()) {
activityProxy.callPropertyAsync(name, new Object[]{d});
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
activityProxy.callPropertySync(name, new Object[] { d });
}
});
}
}

private void releaseDialogs(boolean finish)
Expand Down

0 comments on commit 21ab9e8

Please sign in to comment.