I am working launcher for android. At the moment I am working for address book(yes I want to include it to my launcher), but I am getting NullPointerException. Here
NullPointerException
If you use editor.putString(number,button);, 'number' is your key and 'button' is your default value.
editor.putString(number,button);
If you want to retrieve the value of 'number' in your SharedPreferences, you should call getString(key, defValue) as follow :
getString(key, defValue)
return pres.getString(number, "");