How about creating a method outside of your onCreate () that performs all the actions, and in the onCreate method, it calls this to load the Activity. If you need to update your activity, just call this new method. For instance:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); loadActivity(); } private void loadActivity() {
source share