Use PreferenceActivity instead of Activity.