0

I know the way to restart current Activity, we do is

Intent intent=getIntent();
finish();
startActivity(intent);

but in my case, my settings is in the Settings Activity, if i change the settings and then go back to MainActivity the settings are not applied, I have to restart my app. So, In this case the best way is to restart Activity? Am I right? or there's another way? Suggest me the best way. Thanks!!

Queendevelopers
  • 183
  • 3
  • 20

1 Answers1

2

Read your settings in the onStart callback of the Activity, and show the appropriate UI.

To update the Toolbar, call invalidateOptionsMenu() or supportInvalidateOptionsMenu() if you're using the support lib. This will trigger a call to onCreateOptionsMenu() where you can figure out what to show for the user's current settings.

kenny_k
  • 3,831
  • 5
  • 30
  • 41
  • Best, Thank you theFunkyEngineer, Worked like a charm. Where did you guys study these things from? Sometimes I got surprised from you guys.. – Queendevelopers Aug 22 '16 at 13:29