本文介绍了performaction ACTION_SET_SELECTION无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用android的辅助功能库的新手,我遇到了很多麻烦。但是我认为这不是我的错:
我想使用accessibilitynodeinfo从中间开始搜索栏:

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?

我在Nexus 5中使用android 4.4.2

I use android 4.4.2 in Nexus 5

推荐答案

您不能使用AccessibilityNodeInfo.performAction()指定搜索栏位置。 ACTION_SET_SELECTION操作仅在TextView中实现。

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

这篇关于performaction ACTION_SET_SELECTION无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 17:32