Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Intent Sample
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="YOUR_PACKAGE"
android:versionCode="1"
android:versionName="1.0.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="YOUR_PACKAGE.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="YOUR_PACKAGE.IntentTextReceiveActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name="YOUR_PACKAGE.IntentUrlReceiveActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="play.google.com"
android:pathPrefix="/store"/>
</intent-filter>
</activity>
</application>
</manifest>
  • IntentTextReceiveActivityはシェアされたテキストを受け取る
  • IntentUrlReceiveActivityは特定のURLを受け取る(http://play.google.com/store~)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment