我正在尝试从我的Google Maps应用程序调用外部Android应用程序。
Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + stringLatitude + "," + stringLongitude + "&daddr=" + latitud + "," + longitud+"&dirflg=d"));
startActivity(mIntent);它在Android 2.3.6上运行得很好。
但不是在Android 4.2上,当我第一次单击执行代码的按钮时,代码Google Maps被正确打开,但没有显示任何关于驱动模式的内容。
但是,一旦我回到主应用程序,我再次点击按钮,一切都很好。只有在第一次尝试时才会失败。
我不明白怎么回事
有线索吗?
发布于 2014-03-06 10:26:54
我正在使用以下代码,在Android4.2上运行良好
Intent i = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+a+","+b+"&daddr="+c+","+d+"&mode=driving"));
i.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(i);https://stackoverflow.com/questions/22221477
复制相似问题