views:

37

answers:

1

I have a Contact Activity which is derived from ListActivity, which displays list of contacts, and on click of item, a new Activity Message Activity derived from ListActivity is initialized.

Now I know, I can pack some information in Bundle and pass it before creating activity, but is there a way I can get instance of "ContactActivity" in onCreate method of "MessageActivity"?

+1  A: 

No, sorry, there is no built-in means for you to get at the activity that called startActivity() for your current activity. After all, the original activity might not be in your application (e.g., home screen).

CommonsWare
Anyway thanks, the problem is I am unable to move custom objects between activities through Bundle, Bundle only accepts, strings etc, but not business data classes.
Srikanth Naidu
Not true, if you have your data classes implement `Serializable` or `Parcelable` you can pass them with the `Bundle`
CaseyB