Android Question Listview Click Question

Discussion in 'Android Questions' started by brianwiz12, Aug 3, 2019.

  1. brianwiz12

    brianwiz12 Member Licensed User

    Code
    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
        
    Activity.LoadLayout("1")
        ToolbarHelper.Initialize
        ToolbarHelper.ShowUpIndicator = 
    True 'set to true to show the up arrow
        ACToolBarLight1.InitMenuListener
        sm.Initialize(
    "sm")
        
    Dim offset As Int = 100dip
        sm.BehindOffset = offset
        sm.Mode = sm.LEFT
        
    Dim lftMenu As Panel

        
    'menu that controls the portion of item view
        lftMenu.Initialize("")
        sm.Menu.AddView(lftMenu, 
    00100%x - offset, 100%y)
        lftMenu.LoadLayout(
    "Left")
        ListView1.AddSingleLine(
    "Home")
        ListView1.AddSingleLine(
    "Trivia Episodes")
        ListView1.AddSingleLine(
    "Coming Soon")
        ListView1.AddSingleLine(
    "About App")
        
    'For i = 1 To 4
        'ListView1.AddSingleLine("Item " & i)
        '    ListView1.AddSingleLine("Item " & i)
    '    Next
    End Sub

    Sub Activity_Resume

    End Sub

    Sub Activity_Pause (UserClosed As Boolean)

    End Sub

    Sub ACToolBarLight1_NavigationItemClick
        sm.ShowMenu
        ListView1.Initialize (
    "Home")
        ListView1.Initialize (
    "Trivia Episodes")
    Trivia.click
        ListView1.Initialize(
    "Coming Soon")
        ListView1.Initialize(
    "About App")

    End Sub
    With the code as is When i load the menu it goes right to the trivia section

    Without Trivia.click it loads the menu.

    How do i make the listview items click able to other modules?
     
  2. brianwiz12

    brianwiz12 Member Licensed User

    Update i got it to work with Buttons. Still interested in listview way.

    Also this navigation is only for the main page? How do i get it to show up on all modules in the app without hard coding it?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    There is no reason to use ListView here. Use xCustomListView instead.

    I don't understand this code:
    Code:
    ListView1.Initialize ("Home")
        ListView1.Initialize (
    "Trivia Episodes")
    Trivia.click
        ListView1.Initialize(
    "Coming Soon")
        ListView1.Initialize(
    "About App")
    Looks wrong.

    You can implement the navigation feature in a class and create a class instance in each of the activities.
     
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