sta*_*ick 5 android google-maps
谷歌地图现在提供了一种"共享一个地方"的方法,该方式似乎是预定义的来源列表.当用户在Google地图上搜索某个地点时,无论是特定地址,跨街道还是餐馆名称,都会有一个名为"分享此地点"的新按钮,用于将位置信息发布到Google Buzz,Facebook,Twitter或通过e邮件或短信.我想要将我的应用程序包含在此列表中,或者确定如何获取所选位置的lat/lon.有没有人有任何想法?
我想到了.这是一个示例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>
Run Code Online (Sandbox Code Playgroud)
只需将SEND intent过滤器添加到您的活动中即可."共享此地点"只是使用mime类型"text/plain"执行"SEND"意图.如果您为该类型注册了一个意图过滤器,那么您的应用程序将显示在列表中.我做了.=)
| 归档时间: |
|
| 查看次数: |
2437 次 |
| 最近记录: |