android - Turn ON OFF accessibility event by a Switch Button Click from MainActivity - Stack Overflow

Here is my code inside accessibility service"if (isLongPressEnabled && event.

Here is my code inside accessibility service

" if (isLongPressEnabled && event.eventType == AccessibilityEvent.TYPE_VIEW_LONG_CLICKED) {

            event.source?.text?.let { text ->
                highlightText(event.source!!)
                speakWithRateLimit(text.toString())
            }





        }" and here is my button inside mainactivity "        binding.mySwitchfb.setOnCheckedChangeListener { _, isChecked ->


        saveSwitchState("switchfb", isChecked)


        Log.d("SwitchState", "isEventEnabled: $isChecked")
    }" want to on/off the event by button click. Suggest me with your tasted code.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744213098a4563428.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信