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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:16:36+00:00 2026-05-26T10:16:36+00:00

I am getting some data from the net, which gets parsed with JSoup in

  • 0

I am getting some data from the net, which gets parsed with JSoup in a AsyncTask.

I am having trouble filling the listview correctly.

Edit1 only gets filled with empty fields (..) and the last rows have the value € 0,00.
Edit2 does not get filled at all.

..         edit2Text
..         edit2Text
..         edit2Text
€ 0,00     edit2Text
€ 0,00     edit2Text

Both Edits are in a test.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">

<EditText
    android:inputType="textMultiLine"  
    android:id="@+id/editText1"  
    android:layout_height="wrap_content"  
    android:text="edit1"  
    android:layout_width="200dp"
/>

<EditText
    android:layout_height="wrap_content"  
    android:layout_width="110dp"  
    android:id="@+id/editText2"  
    android:text="edit2" 
    android:inputType="textMultiLine" 
    android:layout_marginLeft="10dp"
/>

</LinearLayout>

The listview should look like this:

Einddatum contract: 08-10-2012
Prijs per maand: € 38,50 /mnd
...

I catch map and map1 to see if they are filled correctly and they do, what i am doing wrong?

10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Einddatum contract:}
10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Prijs per maand:}
10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Einddatum contract:}
10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Prijs per maand:}
10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Nieuw beltegoed:}
10-22 10:35:21.698: I/System.out(8132): Hashmap: {col_1=Tegoed vorige periode:}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=Tegoed tot 09-11-2011:}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=Verbruik sinds nieuw tegoed:}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=Ongebruikt tegoed:}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=Verbruik boven bundel:}
10-22 10:35:21.708: I/System.out(8132): Hashmap: {col_1=Verbruik dat niet in de bundel zit*:}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=08-10-2012}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 38,50 /mnd}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=08-10-2012}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 38,50 /mnd}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 54,64}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 17,28}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 71,92}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 5,32}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 66,60}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 0,00}
10-22 10:35:21.718: I/System.out(8132): Hashmap1: {col_2=€ 0,00}

My code:

@Override 
    protected void onPostExecute(String result) { 
        // create the grid item mapping
        ListView kp = (ListView)findViewById(R.id.kpn);

        String[] from = new String[] {"col_1", "col_2"};
        int[] to = new int[] { R.id.editText1, R.id.editText1 };

        List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
        HashMap<String, String> map = new HashMap<String, String>();
        HashMap<String, String> map1 = new HashMap<String, String>();


        Document doc = Jsoup.parse(kpn);
        Elements tdsFromSecondColumn = doc.select("table.personaltable td:eq(0)");
        Elements tdsFromSecondColumn1 = doc.select("table.personaltable td:eq(1)"); 

        for (Element tdFromSecondColumn : tdsFromSecondColumn) {
            map.put("col_1", tdFromSecondColumn.text()); 
            fillMaps.add(map);

            System.out.println("Hashmap: " + map);

        } 
        for (Element tdFromSecondColumn1 : tdsFromSecondColumn1) {
            map1.put("col_2", tdFromSecondColumn1.text());
            fillMaps.add(map1);

            System.out.println("Hashmap1: " + map1);
        }

        SimpleAdapter adapter = new SimpleAdapter(AndroidLogin.this, fillMaps, R.layout.test, from, to); 
        kp.setAdapter(adapter);
  • 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-26T10:16:37+00:00Added an answer on May 26, 2026 at 10:16 am

    Try this,

    @Override 
        protected void onPostExecute(String result) { 
            // create the grid item mapping
            ListView kp = (ListView)findViewById(R.id.kpn);
    
            String[] from = new String[] {"col_1", "col_2"};
            int[] to = new int[] { R.id.editText1, R.id.editText2 };
    
            List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
            List<HashMap<String, String>> fillMaps1 = new ArrayList<HashMap<String, String>>();
              List<HashMap<String, String>> fill_Maps = new ArrayList<HashMap<String, String>>();
    
     HashMap<String, String> map;
     HashMap<String, String> map1;
    
    
            Document doc = Jsoup.parse(kpn);
            Elements tdsFromSecondColumn = doc.select("table.personaltable td:eq(0)");
            Elements tdsFromSecondColumn1 = doc.select("table.personaltable td:eq(1)"); 
    
            for (Element tdFromSecondColumn : tdsFromSecondColumn) {
    
                      map = new HashMap<String, String>();
                      map.put("col_1", tdFromSecondColumn.text()); 
                fillMaps.add(map);
    
                System.out.println("Hashmap: " + map);
    
            } 
            for (Element tdFromSecondColumn1 : tdsFromSecondColumn1) {
                               map1 = new HashMap<String, String>();                                      map1.put("col_2", tdFromSecondColumn1.text());
                fillMaps1.add(map1);
    
                System.out.println("Hashmap1: " + map1);
            }
    
                            for (int i=0;i<fillMap.size();i++) {
    
                   fill_Map.add(fillMap.get(i));
                   fill_Map.add(fillMap1.get(i));
    }
            SimpleAdapter adapter = new SimpleAdapter(AndroidLogin.this, fill_Map, R.layout.test, from, to); 
            kp.setAdapter(adapter);
    

    And let me know what happen..

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

Sidebar

Related Questions

I'm having some trouble getting my Core Data entities to play nice and order
I have some data I'm getting from a datasource which is a bunch of
I'm getting some data from the web service and saving it in the core
I am getting some junk data returned from a ToString() call on a DateTime
Currently i am having some problems with getting some data out of a DataTable
I'm having a little dilemma with an iphone project. I'm getting some JSON data
I have a data table which already has some values, plus it is getting
I need some methods of storing and getting data from a file (in WIN32
Im getting a connection refused when I try to send some data to my
I'm getting some strange, intermittent, data aborts (< 5% of the time) in some

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.