When I change my activity to another activity which has huawei map it is very slow to open.
huawei version is MED-LX9N
Android version is 10
Ram : 3.0 GB
and free space is 52 / 64 GB
When I click the change activity button it waits 3-5 seconds at first.
Then I back to page and return the map page again it waits only 1 seconds.
my code:
com.huawei.hms.maps.SupportMapFragment supportMapFragment = new com.huawei.hms.maps.SupportMapFragment();
context.getSupportFragmentManager().beginTransaction().replace(fragmentId, supportMapFragment).commit();
supportMapFragment.getMapAsync(huwaiMapReadyCallBack);
on map async:
com.huawei.hms.location.FusedLocationProviderClient fusedLocationProviderClient = com.huawei.hms.location.LocationServices.getFusedLocationProviderClient(activity);
fusedLocationProviderClient.getLastLocation().addOnSuccessListener(activity, location -> {
if (location != null) {
double currentLat = location.getLatitude();
double currentLong = location.getLongitude();
com.huawei.hms.maps.model.LatLng latLng = new com.huawei.hms.maps.model.LatLng(currentLat, currentLong);
com.huawei.hms.maps.CameraUpdate cameraUpdate = com.huawei.hms.maps.CameraUpdateFactory.newLatLngZoom(latLng, zoom);
huaweiMap.moveCamera(cameraUpdate);
}
});
on xml:
<fragment
android:id="@+id/map_fragment"
class="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="350dp" />
It works but very slow how can i solve this issue ? Is it normal ?