Generally doing direct calls between activities like this is a really
bad idea, because the system controls the lifecycle of the activity,
not you, so you have no assurance that the activity you are trying to
call even exists or is the instance you are using.

For direct interactions, the best way to represent this is as a third
class, for which you have a singleton instance in your app that both
activities call on.  Then the shared state can be there, regardless of
which activities are being created and destroyed.

If you really do need direct calls between activities, I would
strongly represent implementing one of them as a Dialog (which can be
full-screen), so that one of the activities can completely own all of
the stuff it is directly calling.

On Oct 15, 1:07 pm, Ramunas <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have two activities in one application. I want call function in
> activity from another activity. How I can do it? Please give me any
> suggestions.
>
> Ramunas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to