如何添加应用程序到"分享这个地方"列表中的谷歌地图 [英] How to add your application to the "share this place" list in Google maps
问题描述
谷歌地图现在提供了一种共享一个地方与什么似乎是各种来源的predefined列表。当用户搜索谷歌地图的地方,无论它是一个特定的地址,交叉的街道,或餐厅的名字,有一个新的按钮,名为分享这个地方的帖子的位置信息,以谷歌的Buzz,Facebook和微博,或通过电子邮件-mail或短信。我想无论是已列入这个名单我的应用程序,或确定如何获得选定位置的纬度/经度。有没有人有什么想法?
Google maps now offers a way to "share a place" with what appears to be a predefined list of sources. When users search for a place on Google Maps, whether it's a specific address, cross-street, or restaurant name, there's a new button called "share this place" that posts the location info to Google Buzz, Facebook, Twitter, or via e-mail or SMS. I would like to either have my application included in this list or determine how to obtain the lat/lon of that selected location. Does anyone have any ideas?
推荐答案
我想它了。下面是一个示例的manifest.xml:
I figured it out. Here's a sample manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourapp" android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".YourApp" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"></action>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
只需添加SEND意图过滤器只是因为它是上面您的活动。 共享这个地方,简单地执行发送意图以text / plain的MIME类型。如果您注册一个意图过滤器的类型,那么你的应用程序会显示在列表中。矿井没有。 =)
Simply add the SEND intent filter just as it is above to your activity. The "share this place" simply performs a "SEND" intent with the mime type of "text/plain". If you register an intent filter for that type, then your app will show up in the list. Mine did. =)
这篇关于如何添加应用程序到&QUOT;分享这个地方&QUOT;列表中的谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!