tags:

views:

23

answers:

1

Hi

Is there a way to get an instance of the activity that has called the currently running activity from the intent object that has been passed to it? eg. if A has called B, I would like to retrieve A's instance from the intent in B's onCreate method. As Activity is not Serializable i am not able to pass the instance in the extras bundle. Any help on this would be great

Thanks.

A: 

It's not possible, and poses security risk, the intent can be fired by a 3rd party application and this way you get access to it.

Why do you want to do that? Just pass as Extras the variables you need, or create a reduced class to hold your data you want to transfer.

Pentium10
HiThanks for your reply. The data I want to pass contains a Socket instance which is not Serializable and so cannot be passed as extras.Also I changed my code a bit and now want to pass this data to a Service when it is started from an activity. Is there any other way to get this Socket instance?
shretima