xxxxxxxxxx
// inside onCreate() :
Intent receivedIntent = getIntent();
String sharedText = receivedIntent.getStringExtra(Intent.EXTRA_TEXT);
if (sharedText != null) {
String sharedLink = sharedText.toString();
// Handle the shared link here
et_link.setText( ""+sharedLink );
}
//add to activity in menifest:
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
// add this:
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</application>