title: Android maps refresh position of marker
body: <p>I want to refresh the position of about 50-100 markers on a map every 5 seconds. It gets the position data from a web service, which all works fine. The problem is, I am getting huge lag on a Galaxy S5 when deleting all the markers and creating new ones. </p>
  
  <p>Is there any other way to move markers? I don't think deleting them and recreating them is a good idea. </p>
  
  <p>I saw other apps using the maps api and refreshing marker positions, but without any lag at all (for example FlightRadar24). How to solve that problem?</p>
  
  <p>Update:
  I am using the code from the answer below but it still recreates the marker every time. Does someone know why?</p>
  
  <p>My ServiceData class:</p>
  
  <pre><code>public static class ServiceData {
      String ID;
      String title;
      String snippet;
      float hue;
      LatLng latlon;
  
      ServiceData(String id, String title, String snippet, float hue, LatLng latlon) {
          this.ID = id;
          this.title = title;
          this.snippet = snippet;
          this.hue = hue;
          this.latlon = latlon;
      }
  }
  </code></pre>
  
  <p>Every time I update the markers I call <code>itemList.clear();</code> (Containing the ServiceData class) to clear it. </p>
  
  <p>then I'm using 
  <code>itemList.add(new ServiceData(id, line, snippet, hue, new LatLng(lat, lon));</code> to add the items to it.</p>