Android应用程序需要检测用户是否从Google Maps Intent返回
我正在制作一个应用程序,并且使用谷歌地图导航
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=" + mLat + "," + mLng + "&daddr=" + mLatitude + " , " + mLongitude + ""));
,如果用户从这个意图返回,我想显示用户导航到的地方的评级栏。 我可以在 Intent 上使用 startActivityForResult 而不是从我的应用程序中使用它吗? 或者是否有另一种方法来检测用户是否回到了我的应用程序?
I'm making an App and I use the Google Maps navigation
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=" + mLat + "," + mLng + "&daddr=" + mLatitude + " , " + mLongitude + ""));
And if the user come back from this intent I want to show the rating bar for the place the user has navigated to.
Is startActivityForResult something I can use on Intent not from my application?
Or is there another way to detect the user did came back to my App?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你是否可以从你刚刚抛出的 Intent 中获取一些东西供 Android 处理,但是......
我建议在你自己的活动之一中显示地图;这样您就可以准确地知道用户做了什么以及他们选择了哪个引脚。然后您可以在该 Activity 中 setResult 并获取信息。
我知道它涉及更多的开发,但您可以完全控制地图视图以及用户在那里执行的操作。我相信你已经看过这个,但请看一下。
http://developer.android.com/resources/tutorials/views/hello -mapview.html
-serkan
I don't know if you can get back something from an Intent you just throw up in the air for Android to handle but...
I'd recommend showing the map within one of your own activity; this way you'd exactly know what the user has done and which pin they've selected. You can then setResult in that Activity and get back the information.
I know it involves little bit more of development but you'd have total control of the map view and what the user do there. I'm sure you've seen this but take a look.
http://developer.android.com/resources/tutorials/views/hello-mapview.html
-serkan