我有一个自定义叠加层,当用户(播放器)移动时,它应该移动.但是我现在拥有它的方式只是不断添加越来越多的叠加层,使得图标具有拖尾效果.
我尝试删除每个位置更新上的叠加层,但它似乎没有删除它.虽然,我不确定是否真正删除它是完成我正在尝试做的正确方法.有没有办法只更新位置和刷新地图?
public void drawMeOnMap()
{
MapView mapView = (MapView) findViewById(R.id.mapView);
mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(R.drawable.p18);
itemizedOverlay = new IOverlay(drawable);
if (mapOverlays.contains(itemizedOverlay))
{
mapOverlays.remove(itemizedOverlay);
}
GeoPoint point = new GeoPoint((int)(1E6*player.latitude), (int)(1E6*player.longitude));
OverlayItem item = new OverlayItem(point, "", "");
itemizedOverlay.addOverlay(item);
mapOverlays.add(itemizedOverlay);
}
Run Code Online (Sandbox Code Playgroud)
任何指导将不胜感激.
因此,我在调试Netbeans Java应用程序时注意到在断言函数中使用函数调用时,您无法在该函数中触发断点或进入该函数.
起初我认为它必须与使用重写函数和我被覆盖的函数没有被调用有关,但我确认这不是正在发生的事情.它仍然被调用,但无法进入.
这是我尝试过的片段:
public class Example
{
public static boolean blah()
{
System.out.println("Executing"); //**Breakpoint here
return true;
}
public static void main(String[] args)
{
assert(blah()); //Cannot step into or hit breakpoint on this line.
blah(); //Can here.
}
}
Run Code Online (Sandbox Code Playgroud)
任何人都有任何想法为什么这不起作用?
我似乎无法弄清楚为什么以下不起作用.
从阅读各地现在看来,这必须以某种方式涉及到像这样.
public class Test<T>
{
public void SomeFunction(IList<IList<T>> ListOfLists)
{
}
}
....
List<List<SimpleClass>> lists = new List<List<SimpleClass>>();
new Test<SimpleClass>().SomeFunction( (IList<IList<SimpleClass>>)lists );
Run Code Online (Sandbox Code Playgroud)
如何要求列表实际上是列表列表?我似乎无法理解我做错了什么.
谢谢,