带着Google Earth Android的意图飞往lat/lon

带着Google Earth Android的意图飞往lat/lon,android,google-earth,Android,Google Earth,我正在使用以下代码使用Google Earth Android意图飞到特定的纬度和经度: Intent myIntent = new Intent(); myIntent.setClassName("com.google.earth", "com.google.earth.EarthActivity"); myIntent.setAction(Intent.ACTION_SEARCH); myIntent.putExtra(SearchManager.QUERY, lat + " " +

我正在使用以下代码使用Google Earth Android意图飞到特定的纬度和经度:

Intent myIntent = new Intent(); 

myIntent.setClassName("com.google.earth", "com.google.earth.EarthActivity"); 
myIntent.setAction(Intent.ACTION_SEARCH); 
myIntent.putExtra(SearchManager.QUERY, lat + " " + lon);
这几乎没问题,只是它似乎想将lat/lon地理编码到最近的地址(如果某个地址在某个范围内)。也就是说,如果LAT/Lon位于南极洲的中部,地图就在给定的点上,但是如果坐标是狮身人面像的,地图就集中在开罗亚历克斯沙漠路的一个地址上。 有没有一种方法可以让Android版谷歌地球在所有情况下都指向给定的lat/lon

试试这个:

Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);

顺便说一句,我正在尝试类似的东西,所以如果有一个调整,我会张贴在这里。可能是需要添加到字符串中的“geo:”。