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

后端 未结 2 452
轻奢々
轻奢々 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: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);
    

提交回复
热议问题