Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Android
  4. How to get ListView's item's indexes?

How to get ListView's item's indexes?

Scheduled Pinned Locked Moved Android
helpquestiontutorial
3 Posts 3 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ElenaRez
    wrote on last edited by
    #1

    Hi, I have ListView activity and it has 3 items on it, I want that if the user click on each one of them the related activity to the list’s item be shown to the user. How can I do this? Could anyone help me to fix this?

    L D 2 Replies Last reply
    0
    • E ElenaRez

      Hi, I have ListView activity and it has 3 items on it, I want that if the user click on each one of them the related activity to the list’s item be shown to the user. How can I do this? Could anyone help me to fix this?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I would guess you want an event handler that fires when the user selects an item. See http://developer.android.com/guide/topics/ui/layout/listview.html[^].

      1 Reply Last reply
      0
      • E ElenaRez

        Hi, I have ListView activity and it has 3 items on it, I want that if the user click on each one of them the related activity to the list’s item be shown to the user. How can I do this? Could anyone help me to fix this?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Check out OnClickListener(). In the handler, you can use the GetId() method of the view that is passed to it.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups