android.intent.action.SEND示例一则

<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;
	}

}

  

posted on 2011-11-01 19:05  还有什么  阅读(2908)  评论(0编辑  收藏  举报

导航