Skip to content Skip to sidebar Skip to footer

Getting Edittext Input From Popupwindow

I was wondering how I could get the input from an editText box in a popupwindow. I tried 2 ways. One with a layout inflator and one without but I either get '' or null even though

Solution 1:

Try the following instead when your popup window is closed:

ViewcontentView= ppw.getContentView();
EditTextusernameInput= (EditText) contentView.findViewById(R.id.username_login_input);
EditTextpasswordInput= (EditText) contentView.findViewById(R.id.password_login_input);
finalStringusernameString= usernameInput.getText().toString();
finalStringpasswordString= passwordInput.getText().toString();

I think your current approach is inflating new views, rather than obtaining the existing views from the popup window.

Post a Comment for "Getting Edittext Input From Popupwindow"