我使用以下方法在地图上添加了标记,并保留了标记记录
public static void showallLocations()
{
ArrayList<LinkedHashMap<String, String>> listshow=latLngStoragepreference.getLatlng();
markerlist=new ArrayList<Marker>();// to keep the marker record so that later we can delete
if(listshow.size()>0)
{
for(int i=0;i<listshow.size();i++)
{
LinkedHashMap<String, String> Linkedhashmap=listshow.get(i);
Set mapSet = (Set) Linkedhashmap.entrySet();
//Create iterator on Set
Iterator mapIterator = mapSet.iterator();
Map.Entry mapEntry = (Map.Entry) mapIterator.next();
// getKey Method of HashMap access a key of map
String keyValue = (String) mapEntry.getKey();
//getValue method returns corresponding key's value
String value = (String) mapEntry.getValue();
String[] parts=value.split("#");
String Latitude=parts[0];
String Longitude=parts[1]; …Run Code Online (Sandbox Code Playgroud)