Add this code in your Manifests
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
//Add this line
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
//---------------
</activity>
</application>
Now Add this code in MainActivity to get share data by other app
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Get intent, action and MIME type
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
// You would then use these three variable to figure out who has sent you an Intent and what they want you to do!
// See here for further instruction: https://developer.android.com/training/sharing/receive.html
// https://developer.android.com/guide/topics/manifest/action-element.html
// https://developer.android.com/reference/android/content/Intent.html#ACTION_GET_CONTENT
}
}
I hope this can help you!
Thank You.