Make onSnapshotFailed run on main thread. (#347)
This commit is contained in:
@@ -721,16 +721,20 @@ public class MapSnapshotter {
|
||||
|
||||
/**
|
||||
* Called by JNI peer when snapshot has failed.
|
||||
* Always called on the origin (main) thread.
|
||||
*
|
||||
* @param reason the exception string
|
||||
*/
|
||||
@Keep
|
||||
protected void onSnapshotFailed(String reason) {
|
||||
if (errorHandler != null) {
|
||||
errorHandler.onError(reason);
|
||||
reset();
|
||||
}
|
||||
protected void onSnapshotFailed(final String reason) {
|
||||
new Handler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (errorHandler != null) {
|
||||
errorHandler.onError(reason);
|
||||
reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user