Is there any way I could use TouchUtils without an InstrumentationTestCase or an ActivityInstrumentationTestCase. I'm doing something in a existing project and using those classes is not possible.
I tried calling TouchUtils.clickView(null, view), and I'm getting an exception: "Could not find method android.test.TouchUtils.clickView" On Jul 6, 5:20 pm, Romain Guy <romain...@google.com> wrote: > > Is it possible to change ascrollbar'slocation programatically? I > > have a ListView and I want to set the position of thescrollbarin my > > code. > > setSelectedPosition(int) > > > Also, I'm using the Instrumentation framework for feature testing. I > > was wondering if it's possible to generate a "drag" movement with > > Instrumentation. > > See the class called TouchUtils. > > > By dragging, I mean holding the mouse button in the > > emulator window, and scrolling (which would make toscrollbarmove). I > > found the way to do some clicks, but I can't find out how to generate > > the drag motion. > > Exactly how you described it: send a MotionEvent ACTION_DOWN, then > several ACTION_MOVE, then an ACTION_UP. TouchUtils will do it for you. > > > > > Thank you. > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---