[android] - post invoking onMapReady to the end of the main thread message queue (#8137)
This commit is contained in:
@@ -15,6 +15,7 @@ import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.support.annotation.CallSuper;
|
||||
import android.support.annotation.IntDef;
|
||||
import android.support.annotation.NonNull;
|
||||
@@ -1006,9 +1007,14 @@ public class MapView extends FrameLayout {
|
||||
public void onMapChanged(@MapChange int change) {
|
||||
if (change == DID_FINISH_LOADING_STYLE && initialLoad) {
|
||||
initialLoad = false;
|
||||
mapboxMap.onPreMapReady();
|
||||
onMapReady();
|
||||
mapboxMap.onPostMapReady();
|
||||
new Handler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mapboxMap.onPreMapReady();
|
||||
onMapReady();
|
||||
mapboxMap.onPostMapReady();
|
||||
}
|
||||
});
|
||||
} else if (change == REGION_IS_CHANGING || change == REGION_DID_CHANGE || change == DID_FINISH_LOADING_MAP) {
|
||||
mapboxMap.onUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user