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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:09:39+00:00 2026-06-11T00:09:39+00:00

i’ve a problem with my app. I have a website where I have a

  • 0

i’ve a problem with my app.

I have a website where I have a ranking table.
I want get from this table all usernames, points and bonuses.

I use a Asynctask for send a HttpRequest through Jsoup to my website.

After i parse my html String, i save in 3 arrays all usernames, points and bonuses.

Ok, now i want to create a dynamic table and i use TableLayout in my main_activity.xml

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/myTableLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
</TableLayout>

This is the application code:

package it.android.mypackage;
import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TableRow.LayoutParams;
import android.widget.TextView;

public class MainActivity extends Activity {

    TextView tv;
    TableLayout chartTable;
    String[] users;
    String[] points;
    String[] bonuses;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        chartTable = (TableLayout) findViewById(R.id.myTableLayout);

        String pathURL = "http://mywebsite.com/chart.aspx";

        DownloadWebPageTask task = new DownloadWebPageTask();
        task.execute(pathURL);

    }

    class DownloadWebPageTask extends AsyncTask<String, Void, String> {

        @Override
        protected String doInBackground(String... urls) {
            String response = "";
            String url = urls[0];
            Document doc = null;

            try {
                doc = Jsoup.connect(url).get();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            response = doc.toString();
            return response;
        }

        @Override
        protected void onPostExecute(String result) {
            Document doc = null;

            doc = Jsoup.parse(result);

            Elements listUsers = doc
                    .select("tr[style=border-bottom: 2px solid black;] td:eq(2)");
            Elements listPoints = doc
                    .select("tr[style=border-bottom: 2px solid black;] td:eq(3)");
            Elements listBonuses = doc
                    .select("tr[style=border-bottom: 2px solid black;] td:eq(4)");


                users = (listUsers.text()).split(" ");
                points = (listPoints.text()).split(" ");
                bonuses = (listBonuses.text()).split(" ");

            int i;
            for (i = 0; i < 100; i++) {

                TableRow tr = new TableRow(MainActivity.this);
                tr.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

                TextView positiontv = new TextView(MainActivity.this);
                positiontv.setText(i+1);
                positiontv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

                TextView usernametv = new TextView(MainActivity.this);
                usernametv.setText(users[i]);
                usernametv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));


                TextView pointstv = new TextView(MainActivity.this);
                pointstv.setText(points[i]);
                pointstv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));


                TextView bonusestv = new TextView(MainActivity.this);
                bonusestv.setText(bonuses[i]);
                bonusestv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

                tr.addView(positiontv);
                tr.addView(usernametv);
                tr.addView(pointstv);
                tr.addView(bonusestv);

                chartTable.addView(tr, new TableLayout.LayoutParams(
                        LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            }

        }
    }
}

When i debug my app i’ve an Exception and in the LogCat i can see:

09-06 14:58:21.230: W/ResourceType(29801): No package identifier when getting value for resource number 0x00000001

I have this error on

positiontv.setText(i+1);

and on three other TextView in setText() method.

usernametv.setText(users[i]);
pointstv.setText(points[i]);
bonusestv.setText(bonuses[i]);

I don’t understand where is the problem.

Some one help me?

  • 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-11T00:09:40+00:00Added an answer on June 11, 2026 at 12:09 am

    solved by replacing:

    positiontv.setText("" + i+1);
    usernametv.setText("" + users[i]);
    pointstv.setText("" + points[i]);
    bonusestv.setText("" + bonuses[i]);
    

    🙂

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have this code to decode numeric html entities to the UTF8 equivalent character.
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am currently running into a problem where an element is coming back from

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.