when user clicks button in application, alter data in document being worked on , @ point want activity rebuild ui. want way if possible because views need updated given change going tricky know in advance.
i tried getting intent, calling finish() on activity calling startactivity same intent. using method can disable pending transitions, it's fine except because creates new instance of activity state can't recovered (unless dumb save preferences). , not acceptable because activity contains viewpager using method returns page 0 whenever update something.
next tried using activity.recreate(). solves issue around state not being saved since appears same instance of activity. in case can't work out how disable animations, there flash on screen.
is there way can make an activity.recreate() call seamless user? or there better way? since within viewpager, refreshing fragment work well, not happening fragment class itself, rather many objects each provide part of ui.
i faced similar problem, when invoked recreate on activity blinking, ended using below code:
// uncomment below line blink effect :p // recreate(); // restart activity without blinking :-) intent intent = new intent(myactivity.this, myactivity.class); startactivity(intent); // start same activity finish(); // destroy older activity overridependingtransition(0, 0); // important seamless transition i know late answer question hope other developers facing same problem.
Comments
Post a Comment