0
아무 것도없는 IME 서비스 (화면 키보드)에서 팝업 창이 나타나게하려고합니다. popUp.showAtLocation (layout, Gravity.CENTER, 0, -100)을 호출 할 때 "Windowmanager $ BadTokenException : Window를 추가 할 수 없습니다 - 토큰 null이 유효하지 않습니다." 관련 활동이없는 서비스에서 팝업 창을 여는 것이 약간 이상한 일임을 알고 있습니다. 가능합니까? 어떤 도움을 주시면 감사하겠습니다IME에서 PopupWindow 만들기 : BadTokenException
public void initiatePopupWindow()
{
try {
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.popup_layout,null);
// create a 300px width and 470px height PopupWindow
popUp = new PopupWindow(layout, 300, 470, true);
popUp.showAtLocation(layout, Gravity.CENTER, 0, -100);
Button cancelButton = (Button) layout.findViewById(R.id.popup_cancel_button);
cancelButton.setOnClickListener(inputView.cancel_button_click_listener);
} catch (Exception e) {
e.printStackTrace();
}
}
:
여기 내 코드입니다. 고마워요