Android debugging return to same place -
lets developing/debugging activity in order reach need pass 4 screens.
each time run app need start over.
i tried using instant run not working. wrote dedicated code automatically skips between screen (instead of making me click manually) not practical..
i cant not open activity because gets information previous activities..
is there way make android studio return same place when build & run, or keep state?
(i know instant run when developing big application not work good, @ least me)
on previous activity
intent.putextra("passed_from_previous_activity", true); startactivity(intent);
on new activity
oncreate() { //this way you'll know if activity's been reached previous activity or not if(getintent().getbooleanextra("passed_from_previous_activity",false)) { //your state values here //i.e., values receive previous activity } }
if have hundred activities (playing devil's advocate) , need start 55th activity tightly coupled 53rd , 54th activity, suggest have button for debugging purposes takes 53rd activity, , transition 54th , 55th.
while turning off instant run solution, need start 1st activity, , have button magically takes using small workaround mentioned above preserving state 53rd activity, , same said above.
Comments
Post a Comment