1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question timer problem

Discussion in 'Android Questions' started by John Decowski, Jul 21, 2019.

  1. John Decowski

    John Decowski Member Licensed User

    Im getting this error upon activating my timer no idea why. Ive used timers in the past and havent go this code before?
    Sub Process_Globals
    'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.
        Dim slidedown As Timer
    "SlideDown1" ,1000)
        slidedown.Enabled = 
    Dim Slidertop As Long
    End Sub

    Sub Globals
    'These global variables will be redeclared each time the activity is created.
        'These variables can only be accessed from this module.

    Private pnlSlide As Panel
    Private imgTradeBuddyLogo2 As ImageView
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
        pnlSlide.Top = ((pnlSlide.Height * -
    1) + (imgTradeBuddyLogo2.Height) ) + 5dip
        Slidertop = pnlSlide.top
        imgTradeBuddyLogo2.top = pnlSlide.height - imgTradeBuddyLogo2.height
    ' this adds it up and multiplys by neg 1 to turn number negative
    End Sub

    Sub Activity_Resume

    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub

    Sub SlideDown1_tick
    If pnlSlide.Top > = 1 Then
            slidedown.Enabled = 
            pnlSlide.Top = pnlSlide.Top + 
    End If
    End Sub

    Sub imgTradeBuddylogo1_Click
    'slidedown.Enabled = True
    End Sub

    Sub imgTradeBuddyLogo2_Click
        slidedown.Interval = 
        slidedown.Enabled = 
    End Sub
    Error code:

    thanks in advance
  2. MarkusR

    MarkusR Well-Known Member Licensed User

    u need to move this into activity create.
    (b4a 9.3 wrote a info at mouse over.)
    slidedown.Initialize("SlideDown1" ,1000)
    slidedown.Enabled = 
    u can also use breakpoints or log(..)
  3. John Decowski

    John Decowski Member Licensed User

    thanks @MarkusR will try! I grabbed the code from a b4j app I made and maybe its fine in b4j?
    MarkusR likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should never write code in Process_Globals. Don't ignore the warnings...
  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