0
我有一个对话框,该对话框在包含多个EditText的服务中启动。我的问题是,当一个EditText获得焦点时,键盘出现,导航栏消失。有没有办法阻止导航栏消失?Android:导航栏在键盘打开时隐藏
这是对话框代码(从里面的服务):
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
final LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE);
_view = inflater.inflate(R.layout.dialog_notif, null);
_edit_1 = (EditText) _view.findViewById(R.id.edit1);
_edit_2 = (EditText) _view.findViewById(R.id.edit2);
_dial = new Dialog(this);
_dial.requestWindowFeature(Window.FEATURE_NO_TITLE);
_dial.getWindow().setBackgroundDrawable(new ColorDrawable(0x66000000));
_dial.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR);
_dial.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
_dial.setContentView(_view);
_dial.setCanceledOnTouchOutside(false);
_dial.setOnDismissListener(new DialogInterface.OnDismissListener()
{
@Override
public void onDismiss(DialogInterface dialogInterface)
{
stopSelf();
}
});
_dial.show();
return START_STICKY;
}
这是什么样子:
'_dial.getWindow()。clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);'这对我来说似乎有点神秘 – xdevs23