In the design company for which I work we try to create a private messaging application which allows us to share different URLs from different applications such as social networks, so that when we share it, it is added in the body of the message, for this We use different intent-filters for each desired application and try to get that URL through an intent something like this:
Bundle ext = getIntent().getExtras()
String URLX = ext.getString(Intent.EXTRA_TEXT)
While I have the intent-filter
defined in the AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:mimeType="text/plain" />
</intent-filter>
We are in doubt to know if this is the correct way to obtain said URL or image in the case of some social networks, and in what way that intent / string can be applied to automatically complete the EditText field of the message body once shared. I hope I could explain myself in a correct and understandable way.
Edit:
We are trying to add the URL obtained through the following code:
Bundle extras = getIntent().getExtras();
String URL = extras.getString(Intent.EXTRA_TEXT);
et1.setText(URL);
But the application is not giving the desired results