I am using the MonkeyRunner Drag functionality, which always does long presses instead of Drag events. Is it possible to disable long press? Is there any other solution for this?
Asked
Active
Viewed 430 times
0
-
You can return false in your onLongPress event, so that longPress will not work – Pragnani Mar 12 '13 at 11:46
2 Answers
0
You can try to override the onLongClick()
method and leave it empty for not performing any action.

Emil Adz
- 40,709
- 36
- 140
- 187
-
i am giving the drag command from the PC to the android device.Actually i am not touching the source code of the android app. So i cant proceed this.. Some where in the stack overflow i have found that we need to disable the long press like that – user2160741 Mar 12 '13 at 11:48
0
You can check if the user "is a monkey" with android.app.ActivityManager.isUserAMonkey()
So just disable your OnLongClickListener if the user is a monkey.
if (ActivityManager.isUserAMonkey()){
myView.setOnLongClickListener(new OnLongClickListener(){
@Override
public boolean onLongClick(View v) {
// TODO Auto-generated method stub
return false;
}
});
}

Charlie-Blake
- 10,832
- 13
- 55
- 90
-
i am giving the drag command from the PC to the android device.Actually i am not touching the source code of the android app. So i cant proceed this.. Some where in the stack overflow i have found that we need to disable the long press like that – user2160741 45 secs ago edit i am giving the drag command from the PC to the android device.Actually i am not touching the source code of the android app. So i cant proceed this.. Some where in the stack overflow i have found that we need to disable the long press like that – user2160741 Mar 12 '13 at 11:51
-
-
then y the monkey runner drag command is not working properly..WE have given coordinates with '1' step and '0' ms delay.. even though its taking as a long press – user2160741 Mar 12 '13 at 11:57
-