我有一个名为'dialog'的警告对话框,但按下最近按钮时不会调用onFocusChange。当有警报对话框时,是否有任何方法可以捕获调用最近按钮?
final AlertDialog dialog = builder.create();
dialog.show();
enterPin.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
Log.w("com.app", "focus");
}
else
{
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
Log.w("com.app", "closeDialog");
}
}
});