Weird screen refresh problem(with code)

Widiar

Member
Licensed User
Longtime User
Howdy everyone. I converted my Gym Timer program to b4a and it's working somewhat ok, except that it has a weird problem with the screen/label/view refresh. Whenever the program is started and you press "start" to make the timer run, it runs just fine (according to log debugs) but doesn't display anything on the main label(s) before you twist your phone and force it to do an orientation change. The buttons on the activity and main panel appear as normal, but the labels just don't seem to get activated before this forced orientation change.

The numbers appear fine also if you first do the orientation change and then press start. After the first forced change it seems to work somewhat ok.

I've been trying to figure out this problem for hours and still have no idea what I'm missing, so if someone can give it a fresh eye, would be thankful. I'm somewhat noobie still with this, so it could be something really obvious and silly - as it usually is.

- Wid
 

Attachments

  • GymTimer.zip
    11.7 KB · Views: 163

mc73

Well-Known Member
Licensed User
Longtime User
You write textsize as float, you read it as int.
Change this
B4X:
FontSize=raf.Readint(raf.CurrentPosition)
to this
B4X:
FontSize=raf.Readfloat(raf.CurrentPosition)
The reason that your labels were showing upon resume, was that the os was not going through the firstTime to get the faulty textsize, thus setting it to zero.
 
Upvote 0

Widiar

Member
Licensed User
Longtime User
You write textsize as float, you read it as int.
Change this
B4X:
FontSize=raf.Readint(raf.CurrentPosition)
to this
B4X:
FontSize=raf.Readfloat(raf.CurrentPosition)
The reason that your labels were showing upon resume, was that the os was not going through the firstTime to get the faulty textsize, thus setting it to zero.

So keen eye! Would have taken me another zillion hours to figure out, thank you very much :sign0188:
 
Upvote 0
Top