Android Question Multiple Activities. Get events

Discussion in 'Android Questions' started by Jean Weets, Apr 7, 2015.

  1. Jean Weets

    Jean Weets Member Licensed User

    In a Multiple Activity I have problems with the ItemClick event of eg. listview. This does not work.
    Button events works.
    In debug mode, I can not watch variables. He stops at a breakpoint. But in the emulator he continues.
    My code of a second activity:


    Code:
    #Region  Activity Attributes
        
    #FullScreen: False
        
    #IncludeTitle: True
    #End Region

    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'These variables can be accessed from all modules.

    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.

        
    Public LKUser As ListView
        
    Private PKUser As Panel
    End Sub

    Sub Activity_Create(FirstTime As Boolean)
        
    Activity.LoadLayout("PageKiesUser")
        KiesUser
    End Sub

    Sub Activity_Resume

    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub

    Sub KiesUser
        
    If File.IsDirectory(Main.TargetDir, "Diensttabel/") = False Then
            
    File.MakeDir(Main.TargetDir, "Diensttabel")
        
    End If
        
    'lbl.Initialize("")
        LKUser.Clear
        
    Dim flpds As List = File.ListFiles(Main.TargetDir & "/Diensttabel")
        
    If flpds.size = 0 Then
            
    Activity.RemoveAllViews
            
    StartActivity(Sync)
        
    Else
            
    Dim flsok As Boolean = False
            
    For x = 0 To flpds.Size -1
                
    Dim flna As String = flpds.Get(x)
                
    If flna.EndsWith(".pds"Then
                     LKUser.AddSingleLine(flna)
                
    End If
                
    If flna = Main.yr & ".sks" Then
                    flsok = 
    True       
                
    End If
            
    Next
            
    If flsok Then
                PKUser.Visible=
    True
            
    Else
                
    Activity.RemoveAllViews
                
    StartActivity(Sync)
            
    End If
        
    End If
    End Sub

    Sub LKUser_ItemClick (Position As Int, Value As Object)
        Main.drn = LKUser.GetItem(Position)
        Main.drn = Main.drn.SubString2(
    0,Main.drn.Length-4)
        
    StartActivity("Main")
    End Sub
     
  2. Peter Simpson

    Peter Simpson Expert Licensed User

    Hello,
    I do not see the following line in your code, preferably in Activity_Create.
    Code:
    LKUser.Initialize("LKUser")
     
  3. Jean Weets

    Jean Weets Member Licensed User

    If you create it with the designer you do not need to initialize the views.
     
    DonManfred likes this.
  4. DonManfred

    DonManfred Expert Licensed User

    What is the eventname which is set in the designer for LKUser?
     
    thedesolatesoul likes this.
  5. Jean Weets

    Jean Weets Member Licensed User

    The same name: LKUser
     
  6. Peter Simpson

    Peter Simpson Expert Licensed User

    @Jean Weets you didn't mention that it was created in the designer. As there's no Global sub's in your post, how are we suppose to know how LKUser was added to your project?
     
  7. Jean Weets

    Jean Weets Member Licensed User

    Code:
    Sub Globals
        
    Public LKUser As ListView
        
    Private PKUser As Panel
    End Sub
     
  8. DonManfred

    DonManfred Expert Licensed User

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

        
    Public LKUser As ListView
        
    Private PKUser As Panel
    End Sub
     
  9. Jean Weets

    Jean Weets Member Licensed User

    In my code is a Global sub. Please scroll up in de code section.
     
  10. Peter Simpson

    Peter Simpson Expert Licensed User

    I missed that one, but it was 3am in the morning @DonManfred
     
    RandomCoder likes this.
  11. Jean Weets

    Jean Weets Member Licensed User

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