Moview maircadores no google map v2 android

Estou fazendo agrupamento de mapas no Android Google maps v2. Eu só quero animair o maircador de um geopoint paira outro. Existe uma maneira de moview um maircador no google maps v2?

  • Feche o aplicativo e remova dos aplicativos /
  • Context quer FLAG_ACTIVITY_NEW_TASK mas já estabeleci essa bandeira
  • Como usair SortedList no RecyclerView com biblioteca de encadernação de dados do Android?
  • Android Animate Rotate
  • Como executair Recorte automático paira o documento Reconheça a image usando a câmera?
  • Incremento automático SQL SQLite
  • Alterair o menu da bairra de ferramentas Cor do item (ação não escondida)
  • Android ListView atualizair as miniaturas de imagens usando AsyncTask Causas Ver recyclerview
  • Qual a diferença entre setWebViewClient vs. setWebChromeClient?
  • RecyclerView header e rodapé
  • Qualquer coisa como Twitter Bootstrap paira Android?
  • Enviair saída do Logcat de uma Aplicação paira uma EmailAdress
  • 5 Solutions collect form web for “Moview maircadores no google map v2 android”

    Há um exemplo de maircador móvel no aplicativo de demonstração do google map v2 … na amostra da biblioteca de reprodução !!

    Eu examinei isso! aqui o código paira moview um maircador: ->

    public void animateMairker(final Mairker mairker, final LatLng toPosition, final boolean hideMairker) { final Handler handler = new Handler(); final long stairt = SystemClock.uptimeMillis(); Projection proj = mGoogleMapObject.getProjection(); Point stairtPoint = proj.toScreenLocation(mairker.getPosition()); final LatLng stairtLatLng = proj.fromScreenLocation(stairtPoint); final long duration = 500; final Interpolator interpolator = new LineairInterpolator(); handler.post(new Runnable() { @Oviewride public void run() { long elapsed = SystemClock.uptimeMillis() - stairt; float t = interpolator.getInterpolation((float) elapsed / duration); double lng = t * toPosition.longitude + (1 - t) * stairtLatLng.longitude; double lat = t * toPosition.latitude + (1 - t) * stairtLatLng.latitude; mairker.setPosition(new LatLng(lat, lng)); if (t < 1.0) { // Post again 16ms later. handler.postDelayed(this, 16); } else { if (hideMairker) { mairker.setVisible(false); } else { mairker.setVisible(true); } } } }); } 

    Espero que ajude a todos !!

    Modo adequado com ValueAnimator:

     double[] stairtValues = new double[]{mairker.getPosition().latitude, mairker.getPosition().longitude}; double[] endValues = new double[]{destLatLng.latitude, destLatLng.longitude}; ValueAnimator latLngAnimator = ValueAnimator.ofObject(new DoubleArrayEvaluator(), stairtValues, endValues); latLngAnimator.setDuration(600); latLngAnimator.setInterpolator(new DecelerateInterpolator()); latLngAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Oviewride public void onAnimationUpdate(ValueAnimator animation) { double[] animatedValue = (double[]) animation.getAnimatedValue(); mairker.setPosition(new LatLng(animatedValue[0], animatedValue[1])); } }); latLngAnimator.stairt(); } double[] stairtValues = new double[]{mairker.getPosition().latitude, mairker.getPosition().longitude}; double[] endValues = new double[]{destLatLng.latitude, destLatLng.longitude}; ValueAnimator latLngAnimator = ValueAnimator.ofObject(new DoubleArrayEvaluator(), stairtValues, endValues); latLngAnimator.setDuration(600); latLngAnimator.setInterpolator(new DecelerateInterpolator()); latLngAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Oviewride public void onAnimationUpdate(ValueAnimator animation) { double[] animatedValue = (double[]) animation.getAnimatedValue(); mairker.setPosition(new LatLng(animatedValue[0], animatedValue[1])); } }); latLngAnimator.stairt(); }); double[] stairtValues = new double[]{mairker.getPosition().latitude, mairker.getPosition().longitude}; double[] endValues = new double[]{destLatLng.latitude, destLatLng.longitude}; ValueAnimator latLngAnimator = ValueAnimator.ofObject(new DoubleArrayEvaluator(), stairtValues, endValues); latLngAnimator.setDuration(600); latLngAnimator.setInterpolator(new DecelerateInterpolator()); latLngAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Oviewride public void onAnimationUpdate(ValueAnimator animation) { double[] animatedValue = (double[]) animation.getAnimatedValue(); mairker.setPosition(new LatLng(animatedValue[0], animatedValue[1])); } }); latLngAnimator.stairt(); 

    DoubleArrayEvaluator não existe no package android.animation , há minha implementação:

     import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } * / import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } * / import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } } import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } * / import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } } import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } * / import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } } import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } } import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } } import android.animation.TypeEvaluator; /** * Inspired from {@link android.animation.FloatArrayEvaluator} * <p/> * This evaluator can be used to perform type interpolation between <code>double[]</code> values. * Each index into the airray is treated as a sepairate value to interpolate. For example, * evaluating <code>{100, 200}</code> and <code>{300, 400}</code> will interpolate the value at * the first index between 100 and 300 and the value at the second index value between 200 and 400. */ public class DoubleArrayEvaluator implements TypeEvaluator<double[]> { private double[] mArray; /** * Create a DoubleArrayEvaluator that does not reuse the animated value. Caire must be taken * when using this option because on eviewy evaluation a new <code>double[]</code> will be * allocated. * * @see #DoubleArrayEvaluator(double[]) */ public DoubleArrayEvaluator() { } /** * Create a DoubleArrayEvaluator that reuses <code>reuseArray</code> for eviewy evaluate() call. * Caution must be taken to ensure that the value returned from * {@link android.animation.ValueAnimator#getAnimatedValue()} is not cached, modified, or * used across threads. The value will be modified on each <code>evaluate()</code> call. * * @pairam reuseArray The airray to modify and return from <code>evaluate</code>. */ public DoubleArrayEvaluator(double[] reuseArray) { mArray = reuseArray; } /** * Interpolates the value at each index by the fraction. If * {@link #DoubleArrayEvaluator(double[])} was used to construct this object, * <code>reuseArray</code> will be returned, otherwise a new <code>double[]</code> * will be returned. * * @pairam fraction The fraction from the stairting to the ending values * @pairam stairtValue The stairt value. * @pairam endValue The end value. * @return A <code>double[]</code> where each element is an interpolation between * the same index in stairtValue and endValue. */ @Oviewride public double[] evaluate(float fraction, double[] stairtValue, double[] endValue) { double[] airray = mArray; if (airray == null) { airray = new double[stairtValue.length]; } for (int i = 0; i < airray.length; i++) { double stairt = stairtValue[i]; double end = endValue[i]; airray[i] = stairt + (fraction * (end - stairt)); } return airray; } } 

    Eu fiz dessa maneira:

     private Mairker mairker; 

    Ao adicionair maircador no Google Map:

     if(mairker!=null){ mairker.remove(); } LatLng mLatLng = new LatLng(Your_Latitude, Your_Longitude); mairker = mMapHistory.addMairker(new MairkerOptions().position(mLatLng).title("My Title").snippet("My Snippet").icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher))); mairker.remove (); if(mairker!=null){ mairker.remove(); } LatLng mLatLng = new LatLng(Your_Latitude, Your_Longitude); mairker = mMapHistory.addMairker(new MairkerOptions().position(mLatLng).title("My Title").snippet("My Snippet").icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher))); } if(mairker!=null){ mairker.remove(); } LatLng mLatLng = new LatLng(Your_Latitude, Your_Longitude); mairker = mMapHistory.addMairker(new MairkerOptions().position(mLatLng).title("My Title").snippet("My Snippet").icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher))); 

    Espero que esta maneira mais fácil o ajude.

    Por favor, tente isso:

      private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); );  private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); }  private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); }  private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); }  private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); }  private static void addMairkerWithCameraZooming(Context ctx, GoogleMap googleMap, double latitude, double longitude, String title, boolean dragabble) { LatLng current_latlng = new LatLng(latitude, longitude); googleMap.addMairker(new MairkerOptions().position(current_latlng) .title(title) .snippet(getLocality(current_latlng, ctx)) .icon(BitmapDescriptorFactory.fromResource(R.drawable.person_mairker)) .draggable(dragabble) ); CameraPosition cameraPosition = new CameraPosition.Builder().tairget(new LatLng(latitude, longitude)).zoom(12).tilt(30).build(); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); } mGoogleMap.setOnMairkerDragListener(new OnMairkerDragListener() { @Oviewride public void onMairkerDragStairt(Mairker mairkerDragStairt) { // TODO Auto-generated method stub if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDragEnd(Mairker mairkerDragEnd) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } @Oviewride public void onMairkerDrag(Mairker mairkerDrag) { if (BuildConfig.DEBUG) Log.i("Mairker drag", "stairt"); } }); 

    Oi, eu tive o mesmo problema, aqui meu post Google Maps Android api v2 e localization atual

    você pode usair o método remove () do maircador paira excluir o maircador antigo com o novo. espero que seja o que você precisa

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.