Android Question Seekbar

Arturs

Member
Licensed User
Longtime User
Hi

How to change Seekbar value from service module (refresh value of seekbar) ?

Regards
Artur
 

Arturs

Member
Licensed User
Longtime User
I thought that I should use it.

CallSubDelayed needs the following parameters:Component as Object, Sub As String

My Sub is
Sub Seek_ValueChanged (Value As Int, UserChanged As Boolean)

How to pass parameters: Value and UserChanged ?

something I do not understand
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Create a sub in your Activity. for example in MAIN
B4X:
sub SetSeekbarValue(value As int)
  myseekbarname.value = value
end sub

And then from your Service
B4X:
CallSubDelayed2(Main,"SetSeekbarValue",Array as int(16))
 
Upvote 0

Arturs

Member
Licensed User
Longtime User
I have the error : "java.lang.IllegalArgumentException: argument 1 should have type int, got int[]"

in the line myseekbarname.value = value
 
Upvote 0

Arturs

Member
Licensed User
Longtime User
It works and simple to use

I thought that I cannot pass int value because CallSubDelayed2 expects Object type.

Could you explain me why we can use Int ?


CallSubDelayed2 (Component As Object, Sub As String, Argument As Object)
 
Upvote 0
Top