To accept the data through intent you have to first set intent-filter,
<activity android:name=".ui.MyActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
And in java you can handle the intent with below code - apply the below code in onCreate
if (Intent.ACTION_SEND.equals(action) && type != null) {
if ("text/plain".equals(type)) {
// Handle text being sent
}
}
Hope this helps!