在位置更改上更新标记Google Map v2 Android
我想在位置更改时更新图像中的所有标记文字,即带有红色圆圈的标记。我尝试了在位置更改上更新标记Google Map v2 Android,android,google-maps,google-maps-android-api-2,marker,currentlocation,Android,Google Maps,Google Maps Android Api 2,Marker,Currentlocation,我想在位置更改时更新图像中的所有标记文字,即带有红色圆圈的标记。我尝试了删除所有以前的标记并用更新的文本再次添加所有标记的想法。但是这样做会产生错误::内存不足异常,并且我还尝试只更新所有标记的文本,但不更新。 这是我的Xml文件,用于自定义标记布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" an
删除所有以前的标记并用更新的文本再次添加所有标记的想法。但是这样做会产生错误::内存不足异常,并且我还尝试只更新所有标记的文本,但不更新。
这是我的Xml文件,用于自定义标记布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeTapMarker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tapmarker" />
<TextView
android:id="@+id/txtTapMarkerDist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="0"
android:paddingBottom="5dp"
android:textColor="@color/white_selector"
android:textSize="12sp" />
</RelativeLayout>
</LinearLayout>
我将此接收器注册如下
registerReceiver(broadcastReceiver, new IntentFilter(BROADCAST_ACTION));
我得到了完美的位置,因此广播接收器代码工作正常。而且,单个标记蓝色标记正在使用位置更新文本。但问题在于,通过位置更改更新多个标记的文本。。。
任何人请帮我解决这个问题。任何帮助都是感激的
registerReceiver(broadcastReceiver, new IntentFilter(BROADCAST_ACTION));