Android Question using seekbar as a numerical input

howard bassen

Member
Licensed User
Longtime User
Is there a way to input an integer to a program using the Seekbar or a similar continuously variable view object ?
 

mangojack

Well-Known Member
Licensed User
Longtime User
Sure ..
B4X:
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
  
   If UserChanged Then
     If Value > 0 Then MyValue = Value
   End If
  
End Sub

If you do use this method ,this might be of interest ... Great Looking Seekbars by Derez ...
 
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
As a followup I suggest to you and others , to create a new app title 'Testing 123' .
This app can then be used to test all sorts of ideas / code snippets / view methods etc. which when perfected, can be pasted to your main app.
This way your main app remains in pristine order and you are more likely to be testing code with fewer interactions.
The test app can be 'Erased / blanked' occasionally as needed.

This might not suit everyone , but I am sure it would have negated the need to ask the above question in forum.
 
Upvote 0

howard bassen

Member
Licensed User
Longtime User
These look like god suggestions, but as a beginner I can't figure out how to get 'Value' and display it in a label or message box.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
how to get 'Value' and display it in a label

Using MangoJacks example:

B4X:
Sub SeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)

   If UserChanged Then
     Label1.Text = Value
   End If

End Sub
 
Upvote 0
Top