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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:52:37+00:00 2026-06-12T07:52:37+00:00

I am getting invalid value in ListView . My code is below. final ArrayList<HashMap<String,

  • 0

I am getting invalid value in ListView. My code is below.

 final ArrayList<HashMap<String, String>> placesListItems = new ArrayList<HashMap<String, String>>();

        runOnUiThread(new Runnable() {
            public void run() {
                try {
                    HashMap<String, String> map = new HashMap<String, String>();

                    for (int i = 0; i < dealList.size(); i++) {
                        map.put(DealItem.DEAL_ID, dealList.get(i).deal_id);
                        map.put(DealItem.DEAL_NAME, dealList.get(i).deal_name);
                        System.out.println("DEAL NAME = "+dealList.get(i).deal_name);
                        placesListItems.add(map);

                    }

                    new PlacesMapActivity(SinglePlaceActivity.this, lon, lat, name, add);

                    ListView lv = (ListView) findViewById(R.id.listView);
                    simpleAdapter = new SimpleAdapter(SinglePlaceActivity.this, placesListItems, R.layout.list_item_deal, new String[] {
                            DealItem.DEAL_ID, DealItem.DEAL_NAME }, new int[] { R.id.reference, R.id.name });
                    lv.setAdapter(simpleAdapter);

when i run this code i am getting answer like this

  10-03 18:37:29.429: I/System.out(3957): DEAL NAME = Sinbad Cafe
  10-03 18:37:52.369: I/System.out(3957): DEAL NAME = Coffee,Tea, Hot Milk
  10-03 18:37:55.189: I/System.out(3957): DEAL NAME = Httpss

But I do not understand why I am getting an invalid value in ListView

Like below:

  Httpss
  Httpss
  Httpss
  • 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-12T07:52:39+00:00Added an answer on June 12, 2026 at 7:52 am
       +-------- HashMap<String, String> map = new HashMap<String, String>();
       |
       |            for (int i = 0; i < dealList.size(); i++) {
       +--------------->  
                        map.put(DealItem.DEAL_ID, dealList.get(i).deal_id);
                        map.put(DealItem.DEAL_NAME, dealList.get(i).deal_name);
                        System.out.println("DEAL NAME = "+dealList.get(i).deal_name);
                        placesListItems.add(map);
    
                    }
    

    Since you have your “HashMap” initialization outside your loop, you are actually overwriting the same hashmap and putting it back to the arraylist..

    Try to move your HashMap initialization inside for-loop..

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

Sidebar

Related Questions

I'm trying to execute the following code, but I'm getting SyntaxError: invalid syntax at
My code is getting the following error: free(): invalid next size (fast) My code:
I am getting the following error: Uncaught Error: Invalid value for property <address>: Following
For the below program I'm getting this error message: Thread 2 terminated abnormally: Invalid
I am trying to put String[] in jsonObject and getting following error java.lang.IllegalArgumentException: Invalid
Im getting invalid argument error when running the following code. Im trying to change
Using sql server 2008 I am getting and invalid precision value error in the
Can someone offer some help on this? I'm getting an 'invalid key value type'
I am getting a weird invalid property value error which only happens in IE7.
So, I'm getting stuck with this piece of code: import java.util.InputMismatchException; import java.util.Scanner; public

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.