Force A MapView To Refresh?
I've a big problem now, I really need some help, I've spent a week fo开发者_运维知识库r it, but fail.
- create a MapActivity (A)
- start another Activity (B) from (A)
- start another MapActivity (C) from (B)
- back (C) -> (B)
- back (B) -> (A)
The first MapActivity (A) is death, never be redrawn whatever I do (zoom in, zoom out, move)
How to force MapActivity (A) work again?
Any help would be appreciated,
Thanks in advance
did you try mapview.invalidate()?
Yes, I too face this issue, try having MapView inside some layout say, MapLayout. And remove MapView from MapLayout in onPause() and add MapView into MapLayout in onResume().
Sample:
@Override
public void onResume(){
super.onResume();
if(mMapLayout.indexOfChild(mMapView)==-1) mMapLayout.addView(mMapView);
}
@Override
public void onPause(){
super.onPause();
if(mMapLayout.indexOfChild(mMapView)!=-1) mMapLayout.removeView(mMapView);
}
Quite old thread but I wasted 3-4 hrs to solve this. I hope this answer will be helpful for others.
There is no way to do this 2 MapActivity can not live at the same time Just do other solution, kill A then create A when come back
精彩评论