I am using google map in my application and display markers.
Now on click of marker window I want to replace the current fragment with other fragment.
for (StoreData store : comp.getArrStoreList()) {
LatLng l = new LatLng(Double.parseDouble(store.getLat()),
Double.parseDouble(store.getLng()));
MarkerOptions marker = new MarkerOptions()
.position(l)
.title(store.getName())
.snippet(store.getCity())
.icon(BitmapDescriptorFactory
.defaultMarker(BitmapDescriptorFactory.HUE_AZURE));
Marker mrkr = mapCompanyList.addMarker(marker);
CompanyStoreData companyStoreData = new CompanyStoreData();
companyStoreData.setStoreData(store);
companyStoreData.setCompanyId(comp.getId());
listStoreData.put(mrkr, companyStoreData);
mapCompanyList
.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {
@Override
public void onInfoWindowClick(Marker marker) {
try {
StoreDetailsFragment storeDetails = new StoreDetailsFragment();
Bundle b = new Bundle();
b.putSerializable(UserDefaults.STORE_OBJECT,
listStoreData.get(marker).getStoreData());
b.putString("StoreAppID", listStoreData.get(marker).getCompanyId());
storeDetails.setArguments(b);
((BaseTabbarContainer) companyListFragment.getParentFragment()).replaceFragment(
storeDetails, true); // here my UI is hang
} catch (Exception e) {
Log.e("Exception", "Exception :: " + e.getMessage());
}
}
});
}
I am creating one hashmap which has <marker,storedata>
marker as a key and storedata (my custom class object) as a value.
on onInfoWindowClick I am getting instance of store data on basis of key of hashmap(). It is working well but
((BaseTabbarContainer) companyListFragment.getParentFragment()).replaceFragment(
storeDetails, true);
Here my UI is getting hang. What is the issue