Added CustomActivity and CustomPreferenceActivity, Code clean up