How do I receive a “Share URL” from browser?

后端 未结 2 450
轻奢々
轻奢々 2021-02-08 06:13

I read this ( How do I handle the browser's "share page" intent in android? ) which I can get the Share link to detect my app, now how do I get Activity to receive

相关标签:
2条回答
  • 2021-02-08 06:46

    When your application receives the "Share page" from the browser, you could also get the title of the webpage:

    String subject = intent.getStringExtra(Intent.EXTRA_SUBJECT);
    
    0 讨论(0)
  • 2021-02-08 06:50

    Once you have created an intent filter, your activity should pop up in the list of activities listening to the share link. Then use this in your activity:

    String url = getIntent().getStringExtra(Intent.EXTRA_TEXT);
    
    0 讨论(0)
提交回复
热议问题