Raman’s code for user pref. See main activity . java for info