开发者

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.

  1. create a MapActivity (A)
  2. start another Activity (B) from (A)
  3. start another MapActivity (C) from (B)
  4. back (C) -> (B)
  5. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜