Possible Duplicate:
Android: How to get the sender of an Intent?
Is there a way in android to find the source activity which fires a INTENT (in the destination activity)?
The scenario is I have two activities A and B. Both fire an intent to call activity C. Activity C displays extra information based on its source. Eg. If call comes from A then C displays only 2 textviews whereas in the case of intent fired by B the activity C displays 3 textviews (basically more information based on who is the caller).
To establish this I need to know who fired the intent calling C. How do I do this?
If you want get intent data, you have to call Fragment's method getArguments() , which returns Bundle with extras. Show activity on this post.
setType(String mimeType) input param is represent the MIME type data that u want to get in return from firing intent(here myIntent instance). by using one of following MIME type you can force user to pick option which you desire. Please take a Note here, All MIME types in android are in lowercase.
A better way to do this would be to use Intent extras to pass parameters to the receiver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With