我通过Android TalkBack检查了所有默认警报对话框.默认的Android Talkback行为是它在对话框中读取所有内容(不停止).有什么方法可以根据我的需要定制它.例如 :
AlertDialog alertDialog = new AlertDialog.Builder(AlertDialogActivity.this).create();
alertDialog.setTitle("Alert Dialog");
alertDialog.setMessage("This is my alert dialog");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_SHORT).show();
}
});
alertDialog.show();
Run Code Online (Sandbox Code Playgroud)
当出现对话框时,它会自动读取"Alert Dialogue.这是我的提醒对话.确定." 但我想控制它,就像它应该只读"警报对话"或"这是我的警报对话"等.
点击"确定"时,它只读"OK",而不是"OK按钮".