Not sure how well it would work, but if you REALLY want to do something like
this, you cold possibly try to just change the view of your current activity
instead of starting a new activity.

I wouldn't recommend it and I'm not sure if that will really work... There
are lots of people who have problems trying to change the view of an
activity and the solution is usually to create a new activity instead of
changing the view.  In your case, however, it might be worth it to look
into...

All that being said, I think you may want to look at re-designing the
workflow of your app....

Hope that helps somewhat,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Thu, Apr 15, 2010 at 8:56 AM, Rodrigo Chiossi <xrodr...@gmail.com> wrote:

> 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 <sebastian.t...@gmail.com> wrote:
> > On Wed, Apr 14, 2010 at 3:03 PM, Rodrigo Chiossi <xrodr...@gmail.com>
> 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
> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> 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.
>

-- 
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
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to