我正在开发一个应用程序,显示由KML文件确定的地图上的路径。具体地,在MapActivity正在启动的图:Android地图后退按钮
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
Uri uri = Uri.parse("geo:0,0?q=http://urltokml");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, uri);
mapIntent.setData(uri);
startActivity(Intent.createChooser(mapIntent, kmlFile));
finish();
}
地图加载罚款,几秒钟之后,由KML描述的路径出现。问题是,当我按下“返回”按钮时,它不会返回到前一个屏幕,而是隐藏KML叠加层。如果再次按下“返回”按钮,它将返回到前一个屏幕。
如何解决这个任何想法?
我现在致电 Uri uri = Uri.parse(“geo:0,0?q = http:// urlhere”); 意图mapIntent = new Intent(Intent.ACTION_VIEW,uri); mapIntent.setData(uri); startActivity(Intent.createChooser(mapIntent,“Title”)); 来自其他活动(非映射的活动),但后退按钮具有相同的效果。 – amr317 2010-06-16 20:23:55
在这一点上它是内置的地图程序,我不知道它如何处理请求。 – CaseyB 2010-06-16 20:31:06