Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find Intent source in Android? [duplicate]

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?

like image 406
Akh Avatar asked Jan 25 '11 01:01

Akh


People also ask

How do I get Intent extra in fragment?

If you want get intent data, you have to call Fragment's method getArguments() , which returns Bundle with extras. Show activity on this post.

What is Intent setType in Android?

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.


1 Answers

A better way to do this would be to use Intent extras to pass parameters to the receiver.

like image 113
Romain Guy Avatar answered Sep 28 '22 04:09

Romain Guy