performaction ACTION_SET_SELECTION not working properly

。_饼干妹妹 提交于 2020-04-18 07:28:50

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/22765040/performaction-action-set-selection-not-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!