2

I have defined an intent filter like this:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="bankpaid"/>
</intent-filter>

And I loaded the activity from the web browser like this:

href="intent://success/#Intent;scheme=bankpaid;package=some.url;end"

I tried to read the data sent to the activity like this:

protected void onStart() {
    Intent intent = getIntent();
    String action = intent.getAction();

    if (Intent.ACTION_VIEW.equals(action)) {
        String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT);
        Log.d("sharedText", sharedText);
    }
    super.onStart();
}

The problem is that sharedText turns out to be null.

How can I send data to an activity from the web and how can the activity receive that data?

Bista
  • 7,869
  • 3
  • 27
  • 55
Sandah Aung
  • 6,156
  • 15
  • 56
  • 98

0 Answers0