I am new to android development.So I want to refresh the current activity when Radio button clicked.When I clicked the radio button I want to change the language and refresh the current Activity without any delay.Now I click the button the current layout gone and open new one.But it takes some time.Anyone can see there is new layout coming. This is my code
Intent intent = getIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
startActivity(intent);
You can try this:
Intent intent = getIntent();
overridePendingTransition(0, 0);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
finish();
overridePendingTransition(0, 0);
startActivity(intent);
this reload's your activity without animation.
This code may work
Intent intent = getIntent();
finish();
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(intent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With