Android-How to reload fragments and activities
For reloading shards
// Reload present fragment
Fragment frg = null;
frg = getSupportFragmentManager().findFragmentByTag("Your_Fragment_TAG");
last FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.detach(frg);
ft.connect(frg);
ft.commit();
Your_Fragment_TAG is the identify you gave your fragment if you created it
This code is for the assist library.
If it would not assist older units, simply use getFragmentManager as an alternative of getSupportFragmentManager
For exercise recharge
Intent i = new Intent(MainActivity.this, MainActivity.class); end(); overridePendingTransition(0, 0); startActivity(i); overridePendingTransition(0, 0);
Within the above code, we have now used overridePendingTransition(), it’s used to take away the exercise creation animation whereas the exercise is being recreated.