只要在 alertDialog 加上 setOnClickListener(), 並在其中設 focus 給 Negative Button 就可以了。

alertDialog.setOnShowListener(new DialogInterface.OnShowListener(){

@Override
public void onShow(DialogInterface dialog) {

Button negative = alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
negative.setFocusable(true);
negative.setFocusableInTouchMode(true);
negative.requestFocus();
}
});
alertDialog.show();
arrow
arrow
    全站熱搜

    姚小新 發表在 痞客邦 留言(0) 人氣()