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 7179869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:13:43+00:00 2026-05-28T17:13:43+00:00

I am using an XML (HttpPost) on ListView to display a list of items

  • 0

I am using an XML (HttpPost) on ListView to display a list of items in my application.
XML File passes the following sample data:

  id=5
  name=Name2
  score=20

The problem I am facing is with the OnItemClick:

public void onItemClick(AdapterView parent, View view, int position, long id)
{
lv.getItemAtPosition(position);

            AlertDialog.Builder alert = new AlertDialog.Builder(context);

            alert.setTitle("Selected Name: " + lv.getItemAtPosition(position));

Here lv is the listview.
The out put shows:

Selected Name: {id=5, name=Name2, score=20}

What should I be doing if I need an output like:

Selected Name: Name2

Thanks
Ram

  • 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-05-28T17:13:44+00:00Added an answer on May 28, 2026 at 5:13 pm

    Another option is you take the String, then tokenize it or something based on the first “,” then take the first token and throw it into the Title of the Dialog.

    Refer: StringTokenizer class

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

Sidebar

Related Questions

I am using Xml Data source to build menu for my application.. but the
I am using XML file for creating Context Menu for my ListView. (Please see
I am sending a xml string to my web application using httpClient#execute(HttpPost, ResponseHandler) It
I am using xml.net in web application When I try load xml through an
I'm using XML for a config file in PHP (Using SimpleXML), in creating the
i am using XML as my backend for the application... LXML is used to
I'm having problem with sending XML-data using HTTP POST to an API. If I
I need to send an xml file using http post in android. I am
Is it application/x-www-form-urlencoded, multipart/form-data, application/xml, text/xml or something else? And more importantly, how do
Using Xml Deserilization I am getting value back from xml file and store the

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.