title: Bounce marker continuously: android maps v2
body: <p>after searching on how to bounce a marker in android maps v2, only one method i found everywhere and its working fine. But only on a marker click, what i need is to make marker bounce continuously like it'll do in JavaScript maps v3. 
  How can i achieve this?</p>
  
  <p>code below:</p>
  
  <pre><code>map.setOnMarkerClickListener(new OnMarkerClickListener() {
  
              @Override
              public boolean onMarkerClick(Marker arg0) {
                  arg0.showInfoWindow();
                  bounceMarker(arg0);
                  return true;
              }
          });
  
  private void bounceMarker(final Marker marker){
          final Handler handler = new Handler();
  
          final long startTime = SystemClock.uptimeMillis();
          final long duration = 1500;
  
          Projection proj = busmap.getProjection();
          final LatLng markerLatLng = marker.getPosition();
          Point startPoint = proj.toScreenLocation(markerLatLng);
          startPoint.offset(0, -100);
          final LatLng startLatLng = proj.fromScreenLocation(startPoint);
  
          final Interpolator interpolator = new BounceInterpolator();
  
          handler.post(new Runnable() {
              @Override
              public void run() {
                  long elapsed = SystemClock.uptimeMillis() - startTime;
                  float t = interpolator.getInterpolation((float) elapsed / duration);
                  double lng = t * markerLatLng.longitude + (1 - t) * startLatLng.longitude;
                  double lat = t * markerLatLng.latitude + (1 - t) * startLatLng.latitude;
                  marker.setPosition(new LatLng(lat, lng));
  
                  if (t &lt; 1.0) {
                      // Post again 16ms later.
                      handler.postDelayed(this, 16);
                  }
              }
          });
  
  }
  </code></pre>