У меня есть всплывающее окно с кнопками и редактировать текст. Затем я касаюсь редактирования текста или используйтевсплывающее окно аварии, если показать мягкую клавиатуру
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);keyboard
приложение разбилось.
Ошибка: java.lang.IllegalArgumentException: тип окна не может быть изменен после добавления окна.
Код:
LayoutInflater layoutInflater = (LayoutInflater) getActivity().getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup_over_map, null);
Context context = this.getActivity().getApplicationContext();
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics metrics = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(metrics);
int displayWidth = metrics.widthPixels;
int displayHeight = metrics.heightPixels;
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(displayWidth - 10, displayHeight - 125);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL;
final PopupWindow popupWindow = new PopupWindow(popupView,
layoutParams.width, layoutParams.height, true);
popupWindow.setSoftInputMode(WindowManager.LayoutParams.
SOFT_INPUT_STATE_VISIBLE);
Button btnDismiss = (Button) popupView.findViewById(R.id.close_window_btn);
btnDismiss.setOnClickListener(this);
etTimeUntil = (EditText)popupView.findViewById(R.id.time_et);
checkOnDemand = (CheckBox) popupView.findViewById(R.id.check_ondemand_popup);
....
Его помощь мне! но экран стал черным цветом ... –
Проверьте конфигурацию PopUpView ...! –