Showing the activity faster

mc73

Well-Known Member
Licensed User
Longtime User
Dear friends,

In VB, I usually bring up a form, with form.show, in order to show it fast, i.e. not wait for all controls to load. In b4a we have the loadLayout, but I was wondering whether there is a tip to show the activity faster, cause in some of my forms, there is a 1.5-2 seconds load time, while the previous activity is still shown. Thank you.
 

mc73

Well-Known Member
Licensed User
Longtime User
Ok, now, after splitting the layout to 2 different layouts, I decided to build the first one programmatically. After setting all their properties, I've discovered that there was absolutely no difference in latency between the designer and programming setting the views! In reality, I'm quite happy with this finding, since it disallows me from altering my original layouts. I guess I have to stick with a progressDialog showing when we have an activity change, thus leaving users to count this too big... 'delay' of 400-600ms during the activity change :p
Thank you all for your help, if I come up with something better, I'll post it here. Or, of course, if anyone has a different approach which may help. :)
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
I like it or not, the solution to faster activity start, was (not efficiently enough for my taste but it works) to not finish the frequent used activities. I handle everything in activity_resume apart from loading the layouts, while I have a universal closeAllActivies flag. When I really want to exit the app, I set this to true, thus each restarted activity (forgotten upon an activity_pause) is closed upon activity_resume. Again, not my taste, but it works so far.
 
Upvote 0
Top