N
N
N24582020-06-14 01:45:31
Android
N2458, 2020-06-14 01:45:31

How to get in the Android application to get a link shared through the share functionality?

For example, there is a YouTube application and it has a “share” button under each video, when clicked, a link of the format https://youtu.be/*********** is transmitted.

So how to learn and its content in your application?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2020-06-14
@N2458

In the activity in the manifest, you need to register that you process links

<intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data
                    android:host="lknpd.nalog.ru"
                    android:pathPrefix="/api/v1/receipt"
                    android:scheme="https" />
            </intent-filter>

The reference value is taken like this
Uri uri = getIntent().getData();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question