Sherif ElNady Sherif ElNady - 3 months ago 27
Android Question

Restart a single task activity

I have a singleTask activity and my app supportsRtl, so when I try to change the language, this SingleTask activity is not affected so I need to restart it, Any help?

Answer

If you're using API 11 and above you can use the:

Activity.recreate()

If you need to support lower API use this to call your activity again:

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