You should never explicitly call onCreate()
. Android calls it when an Activity is created. You should check out the activity lifecycle and see if you can't move some code to another callback method (such as onResume()
) when the user returns from the settings activity.
If you really wish to have onCreate()
called again, you should check out Activity.recreate()
which was added in API level 11. If you're below that API you can work around this with the following code:
Intent intent = getIntent();
finish();
startActivity(intent);
This finished the activity, and starts it again with the same intent that it was created with in the first place.