Thanks for the Answers, but none of them really seems like an option
for me.
Giving more details about what I am doing:
First, the user press a button on the main Activity. When the
LongClick triggers, I start the second Activity wich also has a button
which should be pressed when the activity starts and should only be
released when the user takes his finger off the screen.
In order to triggers the onTouch of the button in the second activity,
i create a copy of the MotionEvent in the first activity and send it
as an Intent Extra to the second activity which call it's own onTouch
passing this MotionEvent as parameter.
The problem is: Even with the second Activity up and running, when the
user takes his finger off the screen for the first time, the
MotionEvent ACTION_UP is delivered to the main activity instead of the
second one. I don know exactly why this happens, but I need to forward
this event to the second activity in order to release the button.
Oh, and btw, I call it a 'child' activity since it has a "getParent()"
method which returns the main activity...

On Apr 15, 5:56 am, Sebastián Treu <[email protected]> wrote:
> On Wed, Apr 14, 2010 at 3:03 PM, Rodrigo Chiossi <[email protected]> wrote:
> > Hi there!
>
> > I have a main Activity and I'm starting a child activity with
> > startActivity(intent).
> > I want to get the Activity Object created for the child. How can I do
> > it?
>
> I don't know for what, as when you start the new "child" activity you
> are in it's context and the other is stopped. Although, If you want
> this, an ugly solution can be to have a Main class that extends
> Application and you implement a tree or a list or whatever you want of
> activities, and everytime you launch a new activity you add it to that
> tree, list or whatever. I don't know for what you will want to, but I
> think you can do that UGLY solution. Then, you add the Main class name
> to the xml manifest, and that class is instanciated before anything.
> You can access public methods with getApplication().
>
> --
> If you want freedom, compile the source. Get gentoo.
>
> Sebastián Treuhttp://labombiya.com.ar

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to