Android Question AddTwoLinesAndBitmap2 problem

Discussion in 'Android Questions' started by gz7tnn, May 31, 2015.

  1. gz7tnn

    gz7tnn Member Licensed User

    Hi all
    No doubt it is a simple error but I cannot see what I have done wrong.
    In the attached example I am using AddTwoLinesAndBitmap2. What I am wanting to do in this example is list all installed apps, then when an entry is clicked on, have that app launched. In the attached sample I just change a label text to the package name when the click happens.

    In the attached file however, when I click any of the entries in the list, while the 'position' is recognised as the correct number, it always returns the text 'value' of the last item added to the listview.

    Example from the log:
    Position during click is : 14
    VPN Services - com.android.server.vpn
    And 'value' is : [Desc=VPN Services, Run=com.android.server.vpn, IsInitialized=true
    ]
    Position during click is : 13
    VPN Services - com.android.server.vpn
    And 'value' is : [Desc=VPN Services, Run=com.android.server.vpn, IsInitialized=true
    ]
    Position during click is : 12
    VPN Services - com.android.server.vpn
    And 'value' is : [Desc=VPN Services, Run=com.android.server.vpn, IsInitialized=true
    ]

    What I am wanting to do is present the Description in the 1st line and the package name below it. Then when the entry is clicked I then want to launch the package.

    But as the code currently is written, when an entry is clicked it always returns the last package name that was added to the list view.

    {In the attached I do have 2 commented sections that use 'AddTwoLinesAndBitmap'. By swapping the app name and package name around it does work for me. But I prefer to have the app name on the top line.}

    Hope that is not confusing..
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. gz7tnn

    gz7tnn Member Licensed User

    Found it, updated my code, and working well.
    Thanks Erel.
     
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