Refreshing a scrollview panel and preventing multiple instances

psmalley

New Member
Licensed User
Longtime User
Couple of newbie questions here, please forgive me if these have been answered elsewhere...

First off, I'm using a scrollview in my app that I dynamically size in code. Each panel is spaced 1 pixel apart from the others. That works fine, but after a while I can see remnants of old panels in the 1 pixel gap. I've tried invalidating the scrollview or the activity itself but the only thing that keeps the scrollview clean is to exit the app and restart it after a while. How do I clean up the old panels?

Secondly, I've noticed that sometimes it seems there are multiple instances of my app running. I will exit the app just to see it load the screen again as though there are two copies of it running. I'm not sure if that's the case or not, but is there a way to ensure that the app can only run one instance of itself at a time?

Thanks for any input you can offer!
-Phil
 

klaus

Expert
Licensed User
Longtime User
1) How do you populate the ScrollView ?
I suppose that you are populating it several times.
If yes, you need to remove all views from the internal Panel of the ScrollView before repopulating it, otherwise the previous views remain on it.

2) You should read in the Beginner's Guide chapter 9 about Process and Activity life cycle.

Best regards.
 
Upvote 0

psmalley

New Member
Licensed User
Longtime User
1) How do you populate the ScrollView ?
I suppose that you are populating it several times.
If yes, you need to remove all views from the internal Panel of the ScrollView before repopulating it, otherwise the previous views remain on it.

2) You should read in the Beginner's Guide chapter 9 about Process and Activity life cycle.

Best regards.

Thank you Klaus, wow that was fast! :sign0098: I will give that a shot and review the life cycle some more.

Thanks,
-Phil
 
Upvote 0
Top