<activity android:name=".ShareLinkActivity"
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
public class ShareLinkActivity extends Activity {
@Override
protected boolean onCreate() {
if (super.onCreate()) {
Intent callerIntent = getIntent();
String subject = callerIntent.getStringExtra(Intent.EXTRA_SUBJECT);
if (subject == null)
subject = "";
Task task = new Task();
task.title = subject;
task.notes = callerIntent.getStringExtra(Intent.EXTRA_TEXT);
// 自己随意定义去向
}
return false;
}
}