title: Add animation to default marker on setOnMarkerClickListener maps api v2 android
body: <p>I am developing an android app, which have fragment containing a Mapview...
  The mapview containing markers according to the locations in the local database..
  is there any way to animate or even change the colour of only clicked marker?
  I mean i have done it in setOnMarkerClickListener, but, when i click on the another marker, the previous marker still in the same color/animation...</p>
  
  <p>Adding the main part of the code below...</p>
  
  <pre><code>String myPath = DB_PATH + DB_NAME;
      myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);
      Cursor c = myDataBase.rawQuery("Select * from location", null);
      if (c != null) {
          if (c.moveToFirst()) {
              do {
                  id = c.getInt(0);
                  if (userPrefs.getString("locale",null)==null || userPrefs.getString("locale",null).equals("en"))
                  {
                      storename = c.getString(1);
                  }
                  else {
                      storename = c.getString(7);
                  }
                  stlatitude = c.getDouble(2);
                  stlongitude = c.getDouble(3);
                  city = c.getString(4);
                  String emirate = c.getString(5);
                  storeloc = new Location("StoreLocation");
                  storeloc.setLatitude(stlatitude);
                  storeloc.setLongitude(stlongitude);
                  addmarker();
              }
              while (c.moveToNext());
          }
      }
      myDataBase.close();
  
      map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
          @Override
          public boolean onMarkerClick(Marker marker) {
              String s= marker.getTitle();
              String snippet= marker.getSnippet();
              markerlat= marker.getPosition().latitude;
              markerlong= marker.getPosition().longitude;
              marker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
              tv.setText(s);
              tv1.setText(snippet);
                  if (s.equals(getActivity().getResources().getString(R.string.here))) {
                      if (relbutton.getVisibility() == View.VISIBLE &amp;&amp; reltext.getVisibility() == View.VISIBLE) {
                          relbutton.setAlpha(1.0f);
                          relbutton.animate().translationY(0).alpha(0.0f);
                          relbutton.setVisibility(View.GONE);
                      } else if (relbutton.getVisibility() != View.VISIBLE &amp;&amp; reltext.getVisibility() != View.VISIBLE) {
                          reltext.setVisibility(View.VISIBLE);
                          reltext.setAlpha(0.0f);
                          reltext.animate().translationY(0).alpha(1.0f);
                          if (userPrefs.getString("locale",null).equals("ar"))
                          {
                              RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(R.id.relativeLayout2);
                              relativeLayout.setGravity(Gravity.LEFT);
                              RelativeLayout relativeLayout1 = (RelativeLayout) view.findViewById(R.id.relativeLayout1);
                              relativeLayout1.setGravity(Gravity.RIGHT);
                          }
                      }
  
                  } else if (relbutton.getVisibility() != View.VISIBLE &amp;&amp; reltext.getVisibility() != View.VISIBLE) {
                      relbutton.setVisibility(View.VISIBLE);
                      reltext.setVisibility(View.VISIBLE);
                      reltext.setAlpha(0.0f);
                      reltext.animate().translationY(0).alpha(1.0f);
                      relbutton.setAlpha(0.0f);
                      relbutton.animate().translationY(0).alpha(1.0f);
                      if (userPrefs.getString("locale",null).equals("ar"))
                      {
                          RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(R.id.relativeLayout2);
                          relativeLayout.setGravity(Gravity.LEFT);
                          RelativeLayout relativeLayout1 = (RelativeLayout) view.findViewById(R.id.relativeLayout1);
                          relativeLayout1.setGravity(Gravity.RIGHT);
                      }
                  } else if (reltext.getVisibility() == View.VISIBLE) {
                      relbutton.setVisibility(View.VISIBLE);
                      relbutton.setAlpha(0.0f);
                      relbutton.animate().translationY(0).alpha(1.0f);
                      if (userPrefs.getString("locale",null).equals("ar"))
                      {
                          RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(R.id.relativeLayout2);
                          relativeLayout.setGravity(Gravity.LEFT);
                          RelativeLayout relativeLayout1 = (RelativeLayout) view.findViewById(R.id.relativeLayout1);
                          relativeLayout1.setGravity(Gravity.RIGHT);
                      }
                  }
              return true;
          }
  
      });
  
  
      directions.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              nwLocation = appLocationService.getLocation(LocationManager.NETWORK_PROVIDER);
              if(nwLocation!=null) {
                  userlatitude = nwLocation.getLatitude();
                  userlongitude = nwLocation.getLongitude();
              if(markerlat!=null &amp;&amp; markerlong!=null) {
                  String uri = "http://maps.google.com/maps?f=d&amp;hl=en&amp;saddr=" + userlatitude + "," + userlongitude + "&amp;daddr=" + markerlat + "," + markerlong;
                  Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
                  intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
                  startActivity(intent);
              }
              }
              else {
                  showSettingsAlert("NETWORK");
              }
          }
      });
      return  view;
  }
  
  private void addmarker() {
      markerOptions.position(new LatLng(stlatitude, stlongitude));
      markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_VIOLET));
      markerOptions.title(getActivity().getResources().getString(R.string.xpressionsstyle));
      markerOptions.snippet(storename);
      map.addMarker(markerOptions);
  }
  </code></pre>