如何放置一个ViewFlipper内多MapViews V1 [英] How to place Multiple MapViews v1 inside a ViewFlipper
问题描述
目标 - 我想表现出不同的地图活动根据数据库,数据显示,使用视图的鳍状肢(或类似的东西)的幻灯片演示
Objective- I want to show slide shows of different Map Activities which show data according to database, using view flipper(or something similar).
问题:
-
查看翻转不能被添加到这不是一个MapActivity如果鳍含有MapView的一个活动。
View Flipper can't be added to an Activity that is not a MapActivity if flipper contains a mapview.
查看挡板不会允许添加多个mapviews为一体MapActivity只能有一个地图视图。
View Flipper does not allows adding multiple mapviews as one MapActivity can have only one map view.
我希望实现什么
- 要显示多个MapActivities这显示标记,路线等基于数据库的数据的幻灯片。
- 要刷新这些MapActivities也有新的数据定期获取并更新数据库。
我'无法找到解决我的问题。我已经通过以下链接走了,但他们没有提供相关的解决方案:
I'am unable to find a solution to my problem. I have gone through the following links but they provided no relevant solution:
<一个href=\"http://stackoverflow.com/questions/7247258/can-a-mapview-be-placed-inside-a-viewflipper-somehow\">Can一个图形页面放置一个ViewFlipper里面不知何故?
请帮忙,并建议是什么这个问题的最好的办法。
Please help and suggest what is the best approach for this problem.
谢谢!
推荐答案
我没有找到标准的解决方案,以作为视图的鳍状肢不能使用我的问题。我做了以下实现MapView类幻灯片 。它是一种比砍一个妥善的解决办法更多,但我别无选择。
I did not find standard solution to my problem as view flipper could not be used.I did the following to implement mapview slide show. Its more of a hack than a proper solution but I had no choice.
- 在while循环,我不停地重新呈现在异步map任务相同的地图视图。
2.After 1地图加载我叫了Thread.Sleep(10000)。
2.After 1st map is loaded I called thread.sleep(10000).
3.我清除了所有的路线和标记的MapView。
3.I cleared the mapview of all routes and markers.
4。我重新呈现第二地图视图。
4.I re rendered the 2nd map view.
在即指否极泰来步骤都不断重复。
5.And the steps were repeated continuously.
@Override
protected Void doInBackground(Void... params) {
final Drawable marker_inBetween;
marker_inBetween = getResources().getDrawable(R.drawable.blue_pin);
marker_inBetween.setBounds(0, 0,
marker_inBetween.getIntrinsicWidth(),
marker_inBetween.getIntrinsicHeight());
helper = new DbHelper(getApplicationContext());
// show slide show
while (true) {
ArrayList<String> IdList =showAllPeopleOnMap();
util.haveASleep(slideShowInterval);
showEachPersonRouteOnMap(IdList);
resetVariables();//resets lists,routes,removes markers etc
}
}
return null;
}
感谢。
这篇关于如何放置一个ViewFlipper内多MapViews V1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!