Code example for AutoCompleteTextView

Methods: getText

0
    @Override 
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);
 
        if (positiveResult) {
            String username = user.getText().toString();
            String password = pass.getText().toString();
 
            SharedPreferences prefs = getContext().getSharedPreferences("VRToolkit", Context.MODE_PRIVATE);
            SharedPreferences.Editor editor = prefs.edit();
            editor.putString("key_username", username);
            editor.putString("key_password", password);
            editor.apply();
        } else { 
            user.setText("");
            pass.setText("");
        } 
    } 
 
    @Override 
Connect your IDE to all the code out there  Get Codota for Java