Skip to content

Instantly share code, notes, and snippets.

@sakebook
Last active December 23, 2015 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakebook/6668500 to your computer and use it in GitHub Desktop.
Save sakebook/6668500 to your computer and use it in GitHub Desktop.
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