cenyu Active Member Licensed User Longtime User Dec 9, 2017 #1 Hi i have some strange problem...I have two activities - one MainActivity and Activity#1. When from MainActivity i call StartActivity("Activity#1") Activity#1 is loaded BUT when i go back with Activity.Finish Activity#1 stay loaded and new StartActivity("Activity#1") only call Activity.Resume not Create...WHY? AND HOW DESTROY ACTIVITY#1? Or this is something i don't understand :-(
Hi i have some strange problem...I have two activities - one MainActivity and Activity#1. When from MainActivity i call StartActivity("Activity#1") Activity#1 is loaded BUT when i go back with Activity.Finish Activity#1 stay loaded and new StartActivity("Activity#1") only call Activity.Resume not Create...WHY? AND HOW DESTROY ACTIVITY#1? Or this is something i don't understand :-(
DonManfred Expert Licensed User Longtime User Dec 9, 2017 #2 cenyu said: when i go back with Activity.Finish Activity#1 stay loaded and new StartActivity("Activity#1") only call Activity.Resume not Create...WHY? Click to expand... act1 is your main. You start act2 and then use act.finish in act2. So android will point you back to act1 which is the default behaviour. And the EXPECTED. activity_create is only called if your activity is CREATED. cenyu said: AND HOW DESTROY ACTIVITY#1? Click to expand... DONT SCREAM!!! Code: 'in act1 startactivity(act2) activity.finish Upvote 0
cenyu said: when i go back with Activity.Finish Activity#1 stay loaded and new StartActivity("Activity#1") only call Activity.Resume not Create...WHY? Click to expand... act1 is your main. You start act2 and then use act.finish in act2. So android will point you back to act1 which is the default behaviour. And the EXPECTED. activity_create is only called if your activity is CREATED. cenyu said: AND HOW DESTROY ACTIVITY#1? Click to expand... DONT SCREAM!!! Code: 'in act1 startactivity(act2) activity.finish
cenyu Active Member Licensed User Longtime User Dec 9, 2017 #3 I agree. You are right! Can i destroy act2? How to call Activity CREATE again? Thanks! Upvote 0
cenyu Active Member Licensed User Longtime User Dec 9, 2017 #4 I found it!!! The problem was in Activity_Resume. There i put code that wait for data from server... Thanks DonManfred! Upvote 0
I found it!!! The problem was in Activity_Resume. There i put code that wait for data from server... Thanks DonManfred!
DonManfred Expert Licensed User Longtime User Dec 9, 2017 #5 cenyu said: Can i destroy act2? Click to expand... If you leave act2 using activity.finish then the act2 will be created again if you recall it again from act1. Upvote 0
cenyu said: Can i destroy act2? Click to expand... If you leave act2 using activity.finish then the act2 will be created again if you recall it again from act1.