Can I get information about which application sent the intent?

Can I tell which application sent the intent or any related information?

Here is an example scenario: My application is selected from the Share menu in another application. Then my application receives the intent ACTION_SEND, with some content that can be transmitted, for example, with some text.

Then I would like to do different things based on where this text comes from. If he came from a Facebook application, I would like to do so-and-so. If this came from the Twitter application, I would like to handle it a little differently.

Is any information available to identify the sender to the recipient?

thank

+3
source share
2 answers

, , Intent Java , . .

+3

, getApplication(), getApplicationInfo()? , .

- :

ApplicationInfo appInfo = getApplication().getApplicationInfo();

, .

100%, , .

-2

Source: https://habr.com/ru/post/1796424/


All Articles