I am recieving some text from other apps, for example if people share a video from youtube app, my app will show up in the shareable list. If they choose my app, I want to get the text content.
I have an intent-filter like this.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:host="*" android:mimeType="text/*" />
</intent-filter>
I can access the data using the onNewIntent method from the activity.
override fun onNewIntent(intent: Intent?) {
Log.d(TAG, intent?.getStringExtra(Intent.EXTRA_TEXT).toString())
super.onNewIntent(intent)
}
But I want to access the text inside a composable function, how can I do that?