Can't Remove Polyline on Google Map (Android)
<p>I'm creating app for tracking my step. I use Google MAP API(V2). I drew my step while walking (realtime)
this is my code.</p>

<pre><code>    case R.id.btn_location:
            if(polyline != null) {
                polyline.remove();
            }
            if(mStatus == IDLE) {
                map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
                        .getMap();
                getmyLocation.getmyLocation();
                map.clear();
            }
             break;
case R.id.btn_can_location:

            if (mStatus == RUNNING) {
                mTimer.removeMessages(0);
                mPauseTime = SystemClock.elapsedRealtime();
                mStatus = IDLE;
                loc_manager.removeUpdates(listener);
             break;
</code></pre>

<p>//----------------------------------------------------------------------------------------------/</p>

<pre><code>public class getMyLocation {
  private void getmyLocation() {
        if (loc_manager == null)
            loc_manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        long time = 3000; 

        float minDistance = 10;

        loc_manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, time, minDistance, listener);
        }
    }


private void getmyLocation() {
        if (loc_manager == null)
            loc_manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        long time = 3000; 

        float minDistance = 10;

        loc_manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, time, minDistance, listener);

static class MyLocationManager implements LocationListener {
    public void onLocationChanged(Location location) {
     polyline = map.addPolyline(polylineOptions.add(new LatLng(location.getLatitude(), location.getLongitude())));
        polylineOptions.width(5);
        polylineOptions.color(Color.RED);

        map.addPolyline(polylineOptions);
}
</code></pre>

<p>Drawing route for realtime is good. But Removing Polyline is not working. 
Helpme</p>