Android Question ListView_ItemClick needs many click to work

Discussion in 'Android Questions' started by Idan Arad, Jul 27, 2015.

  1. Idan Arad

    Idan Arad Member Licensed User

    Hi
    Maybe someone can help:
    I have a list view with few options to choose from.

    On galaxy s2 with android 4.4 : clicking the listview items - nothing happens at the beginning.
    I need to click the items many times , with no respond , until eventually it starts to work.

    the same code run with no issues on Nexus 5 with android 5.1.

    I guess I am breaking some kind of compatability here...
    Sub listviewMenu_Itemclick (Position As Int, Value As Object)

    If (Position=0) Then
    StartActivity(...)

    Else If (Position=1) Then
    Msgbox(...)

    Else If (Position=2) Then
    Msgbox(...)
    Else
    Msgbox (...)
    End If

    End Sub


    Thanks,Idan
     
  2. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I suggest to connect in Debug Mode and place a Log statement at the very beginning of the ItemClick event to see if the event is actually being triggered and then work form there. with what you ave provided there is to little to give reliable advice.

    Please also use code tags when posting code [ CODE]your code here.. [ /CODE] (remove space after opening bracket) to display code like this...

    Code:
    Sub listviewMenu_Itemclick (Position As Int, Value As Object)

    If (Position=0Then
    StartActivity(...)

    Else If (Position=1Then
    Msgbox(...)

    Else If (Position=2Then
    Msgbox(...)
    Else
    Msgbox (...)
    End If

    End Sub
     
  3. mangojack

    mangojack Well-Known Member Licensed User

    @RandomCoder for your info you can use the [ Plain] [ /Plain] tags to display the "Please use the [ Code] tags message (all without spaces)

    ie. @Idan Arad ... Please also use code tags when posting code [CODE]your code here.. [/CODE]
     
    DonManfred likes this.
  4. Idan Arad

    Idan Arad Member Licensed User


    Tried debug mode...the event is not triggered until you click 10 to 15 times.
    After that the event is triggered normally.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    As RandomCoder wrote it is better to test it with Log instead of Msgbox.
     
  6. Idan Arad

    Idan Arad Member Licensed User

    Thanks Erel
    I will try , but as far as I see the event is not triggered at all,so whatever inside the sub doesn't really matter.
     
Loading...