Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8239231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:04:35+00:00 2026-06-07T20:04:35+00:00

I want to get different values when I click different list items in my

  • 0

I want to get different values when I click different list items in my ListView. For example; when code=1 I want to get different values, when code=2 I want to get different values. How can I do this?

Here is my code.


                    Element e = (Element) nl.item(i);


        map.put(KEY_CODE, conParser.getValue(e, KEY_CODE));
        map.put(KEY_NAME, conParser.getValue(e, KEY_NAME));
        map.put(KEY_COVERS, conParser.getValue(e, KEY_COVERS));
        map.put(KEY_TABLE, conParser.getValue(e, KEY_TABLE));
        map.put(KEY_SALES, conParser.getValue(e, KEY_SALES));

        items.add(map);


    }


              final ListAdapter adapter = new SimpleAdapter(this, items,
            R.layout.list_item,
            new String[]    {KEY_CODE,KEY_NAME,KEY_COVERS,KEY_TABLE,KEY_SALES}, 
         new int[] {R.id.kod,  R.id.name,R.id.person,R.id.table,R.id.sale});


              setListAdapter(adapter);

             ListView list= getListView();
             reportList.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            // TODO Auto-generated method stub


              startActivity(new Intent(NewActivity.this,SingleNewActivity.class));

        }
    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:04:36+00:00Added an answer on June 7, 2026 at 8:04 pm

    It’s not clear what you want, but I figure out that you want to get the clicked item.
    So in the onItemClick method the parent parameter is the current list. So what you have to do is get the adapter from the list, and then get the item clicked and you know that because you have the position. So basically you have to write inside the onItemClick this:

    parent.getAdapter().getItem(position)

    And you get the item selected so depending on the item instance you will get the id value for example.
    Best

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to get different array values in my ajax callback
I have a string pc1|pc2|pc3| I want to get each word on different line
i want to access or get the class which is present in different project.How
What I want to do is get the data from two different tables (table1
I want get the time used for a case so I can create an
I just want get a 2 dimension array of List in c#. In my
I have a list that uses a itemRendererFunction to get custom item renderers. Is
I want to use a JQuery UI dialog but i can't. when I click
I want to target multiple buttons and get different value by clicking different button.
I am hitting a lot of different sites to get a list of information

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.