Hi Kitzy.
If you just click the button, the second activity should start in a
state A. if you longpress the button, the activity should start in a
state B and go to state A upon releasing the button (In fact, upon
releasing the screen, since the button does not exists in the second
activity), so i can't start it after release. Your second suggestion
is actually what I managed to do as a workaround: I broadcast an
intent whenever the first activity receives an event and the second
activity has already been started (I set a flag after starting). It's
not a beautiful code, but it's the best solution so far...
I know it would be easy just not to use this kind of interaction, but
this is the key feature of the app.

On Apr 16, 1:48 am, Kitzy <kitzyk...@gmail.com> wrote:
> What if you start your activity after release?  Or use a broadcast
> receiver?
>
> Why do you need the new activity to know when you release?
>
> -Kitzy
>
> On Apr 15, 10:35 am, Rodrigo Chiossi <xrodr...@gmail.com> wrote:
>
>
>
>
>
> > I have already tried 3 different approaches to the problem:
> > The first was this one i described previously, which would be the
> > ideal for my app.
> > The second one, i created an ActivityGroup which was responsible for
> > starting two activities and on LongClick event I was swaping the
> > DecorViews of the activities. Still, the same problem happened: the
> > ACTION_UP was being delivered to the wrong activity.
> > My last approach was to create a single activity and call
> > setContentView to swap between the two layouts, and still, the event
> > was not delivered to the right view.
> > I'm just wondering if there is a way for an Activity to request Input
> > events...
>
> > @Mark: you are right, i messed those approaches a little. I have the
> > getParent only when I use an ActivityGroup.
>
> > On Apr 15, 12:23 pm, Mark Murphy <mmur...@commonsware.com> wrote:
>
> > > Rodrigo Chiossi wrote:
> > > > 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.
>
> > > Why are you using multiple activities? UI events are not designed to
> > > span multiple activities.
>
> > > > 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.
>
> > > Ick.
>
> > > > Oh, and btw, I call it a 'child' activity since it has a "getParent()"
> > > > method which returns the main activity...
>
> > > Then you are not starting the "child activity" via startActivity().
>
> > > --
> > > Mark Murphy (a Commons 
> > > Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> > > _Android Programming Tutorials_ Version 2.0 Available!
>
> --
> 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 
> athttp://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-beginners?hl=en

-- 
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