I get a null pointer exception at this row:
public void hideKeyboard(){ InputMethodManager inputManager = (InputMethodManager) this.
Just use this one:
public void hideKeyboard(View v){ InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getWindowToken(), 0); }