Seekbar question

positrom2

Active Member
Licensed User
Longtime User
Hallo,
in a more lengthy code I want to use seekbar:
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
startt=Value
Label4.Text=startt
Log(startt)
DoEvents' (just for sure)
End Sub

Nothing happens when dragging the seekbar, no log, no update of Label4.
What might be the reason?
Regards, positrom2
 

walterf25

Expert
Licensed User
Longtime User
Seekbar

It seems to work fine with me, how are you adding the seek-bar to your project, are you adding it diagrammatically or through the designer?

cheers,
Walter
 
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
Thanks for the answers.
Notably a simple seekbar example works, but not that in my more lenghty code.
Seekbar was added by Designer and no initialize by code. I can push the bar and move it but nothing happens. Now I deleted seekbar1 in code and designer and added by designer a new one (seekbar2) -but same problem.
I think seekbar was working since a few days ago and I was surprised that it fails by now.

Could there be a relation with another issue I realized: I use B4A 1.92 and initially Designer showed me in Device details the device reolution. Now the field is empty. I am using Archos Internet Tablet70b (Android 3.2.1). But, since the simple test code works, that's probably a different issue.

Thanks for help.
Regards, positrom2
 
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
It is not raised. Breakpoint is set in the sub seekbar2... using debug mode. Program isn't "breaked".
thanks, positrom2
 
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
Erel,
Tablet is connected via bluetooth to a µcontroller.
Meanwhile I discovered the following: When I start the program with the µcontroller and bluetooth chip unpowered the seekbar2 does what it shall do (raising the event as seen by a breakpoint in the sub and by a change of label4.text). But when µcontroller and bluetooth chip are powered up, program runs but does nor respond to a seekbar2 change (no event raised).
Thanks for help.
regards, positrom2
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
First you should move all the UI code from outside of the If FirstTime = True block.
Read the activities life cycle tutorial for more information.

This code seems to create an endless loop:
B4X:
Sub Hauptschleife

Dim unendlich As Boolean
unendlich=True

Do While unendlich
   
zeichnen

stress=(indexr-indexl)/2
Label3.Text=NumberFormat(stress,2,0)&" Dis"

Loop
End Sub
 
Upvote 0

positrom2

Active Member
Licensed User
Longtime User
Erel, thanks for investigating my prog.
This code seems to create an endless loop:
That is the intention. The program shall loop endlessly, maybe for a day at least (when it were finished ultimately, my learning curve is more or less flat).... What else could be done to achieve an effective endless loop? I read somewhere it is forbidden, so somebody advised me for that trick.

Read the activities life cycle tutorial
There seems to be just one activity and the seekbar problem arises immediately (not after pausing or resuming). Notably in contrast to the seekbar problem the btnCls_Click event works. I don't see which guide from the lifecycle tutorial could help to get around that problem.

Thanks for the help,
regards positrom2
 
Upvote 0
Top