Android - Preventing TalkBack to read the application Name and current Orientation

后端 未结 6 1521
死守一世寂寞
死守一世寂寞 2021-02-20 15:14

Problem is I am using TTS to read a long string message when my activity is launched, but TalkBack automatically reads the application name in the middle of it and cuts the long

6条回答
  •  北海茫月
    2021-02-20 16:04

    But this line in onCreate of Launcher Activity

    Kotlin:

    ViewCompat.setImportantForAccessibility(window.decorView,
    ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO)
    

    Java:

    ViewCompat.setImportantForAccessibility(getWindow().getDecorView(),
    ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);
    

    This worked for me.

提交回复
热议问题