0

I am new at working with the accessibility library of android i have a lot of troubles. But there is one i think is not my fault: I want to use the accessibilitynodeinfo to start a seekbar from the middle:

if(mychildinfo.getClassName().toString().contains("SeekBar")){              
         Bundle b = new Bundle();
         b.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT, 49);
         b.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT, 50);
         mychildinfo.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION,b);
}

but it doesn't work and i don't get any feedback of something to be wrong in my code? Can anybody help me, please?

I use android 4.4.2 in Nexus 5

user3399757
  • 13
  • 1
  • 4

1 Answers1

1

You cannot use AccessibilityNodeInfo.performAction() to specify seek bar position. The ACTION_SET_SELECTION action is only implemented in TextView.

alanv
  • 23,966
  • 4
  • 93
  • 80
  • It is somehow strange because i see the SET SELECTION ACTION as a return value in the getActions() function. But thanks a lot! Do you know if there is any way to specify the seek bar position using the Accessibility Library? – user3399757 Apr 01 '14 at 07:38
  • You can move it forward and back in 20% increments using ACTION_SCROLL_FORWARD and ACTION_SCROLL_BACKWARD, but you can't set a specific value. – alanv Apr 01 '14 at 16:15