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 <[email protected]> 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 <[email protected]> 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 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

