Android Question ICOSseekbar valuechanged() method

Discussion in 'Android Questions' started by Najirm, Aug 11, 2015.

  1. Najirm

    Najirm Member Licensed User

    I use a seekbar from ICOSSeekbar library as below.

    Code:
    Sub seekbar_ValueChanged(num As Int, bool1 As Boolean)
      
    If bool1 Then
      
    If num == 0 Then
      
    seekbar.Value = 1
      lbl.Text = 
    1 
     
      
    Else If num == 1 Then
      
    seekbar.Value = 1
      lbl.Text = 
    1
     
      
    Else If num == 2 Then
      
    seekbar.Value = 2
      lbl.Text = 
    2
     
     
      
    Else If num == 3 Then
      
    seekbar.Value = 3
      lbl.Text = 
    5
     
      
    Else If num == 4 Then
      
    seekbar.Value = 4
      lbl.Text = 
    10
     
     
      
    Else If num == 5 Then
      
    seekbar.Value = 5
      lbl.Text = 
    15
      
    End If
      
    End If
      
    CallSub("ClassName","MethodName")
    End Sub
    Once the seekbar is swiped CallSub("ClassName","MethodName") is called many times.

    How can I call "CallSub("ClassName","MethodName")" only when the swipe is finished?
     
  2. LucaMs

    LucaMs Expert Licensed User

    I don't know ICOSSeekbar but that event raises many times because you set seekbar.Value inside the routine, then there is a loop, a recursion, I suppose.
     
  3. Najirm

    Najirm Member Licensed User

    How can I modify the method so that the
    CallSub("ClassName","MethodName")
    is called only when swipe is released or dismissed?
     
    Last edited: Aug 13, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice