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

  • SEARCH
  • Home
  • 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 7782569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:35:04+00:00 2026-06-01T19:35:04+00:00

Hi this is my code i want to access the KEY_ID that i put

  • 0

Hi this is my code i want to access the KEY_ID that i put in maplist on list item click in a variable..
Please Help me How i can do this.

ArrayList (HashMap)  (String, String) mapList = new ArrayList(HashMap(String, String)) ();
    XMLParser parser = new XMLParser();
    Document doc = parser.getDomElement(xml); 
// getting DOM element
    NodeList nl = doc.getElementsByTagName(KEY_Route);

    // looping through all song nodes <song>
    for (int i = 0; i < nl.getLength(); i++) {
        // creating new HashMap
        HashMap<String, String> map = new HashMap<String, String>();

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

        // adding each child node to HashMap key => value

        map.put(KEY_ID, parser.getValue(e, KEY_ID));
        map.put(KEY_SchoolName, parser.getValue(e, KEY_SchoolName));
        map.put(KEY_ChildrenName, parser.getValue(e, KEY_ChildrenName));
        map.put(KEY_AlertTime, parser.getValue(e, KEY_AlertTime));
        map.put(KEY_RouteName, parser.getValue(e, KEY_RouteName));
        map.put(KEY_Notification, parser.getValue(e, KEY_Notification));
        map.put(KEY_StopName, parser.getValue(e, KEY_StopName));
        // adding HashList to ArrayList
        mapList.add(map);
    }

    list = (ListView) findViewById(R.id.list);

    // Getting adapter by passing xml data ArrayList
    adapter = new LazyAdapter(this, mapList);
    list.setAdapter(adapter);

    // Click event for single list row
    list.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
            int idw = position;
            long logss = id;

// There i want to access the KEY_ID..              

            } catch (Exception e) {
                e.printStackTrace();
                progressDialog.dismiss();
            }

        }
    });
}
  • 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-01T19:35:06+00:00Added an answer on June 1, 2026 at 7:35 pm

    In your onItemClick method, you need to fetch HaspMap out from mapList object from a specific position:

    HashMap<String, String> map = mapList.get(position);
    
    //and then read values out from 'map' object
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

according to this code if i want to access imageView1 and imageView2 how can
Hi can you help me with this?? I have this code and i want
I have this code that I want to make point-free; (\k t -> chr
This code selects the nodes, I want to work on...: <xsl:variable name=rootTextpageNode select=$currentPage/ancestor-or-self::node [@level
This code didn't works as expected. I want to select all the posts that
I have a question concerning this code which I want to run on QNX:
I'm new to PHP and I want this code <option value= disabled=disabled>-------------</option> to be
In this particular code sample I want to reference the second overloaded method (int
I want to add this code: <link rel=stylesheet type=text/css href=css/global.css /> <!--[if lt IE
Why this code don't work,when i want run this code vwd 2008 express show

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.