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.
- In a while loop, I kept re-rendering the same map view in the async map task.
2.After 1st map is loaded I called thread.sleep(10000).
3.I cleared the mapview of all routes and markers.
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;
}
Thanks.