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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:57:22+00:00 2026-05-27T05:57:22+00:00

Possible Duplicate: nullPointerException in multi column list I have following app which fetches data

  • 0

Possible Duplicate:
nullPointerException in multi column list

I have following app which fetches data from URL and displays it.

The problem is I get the output in list which consists of various rows.

Now I want to split the row data into 4 columns as below.

SBIN ;1911.05;1886.85;1.28 should be displayed as 4 columns(seperated by ‘;’) within 1 row and not as a single element. See this screenshot for reference:

Screenshot of the app

ReadWebPageAsyncTask.java

public class ReadWebpageAsyncTask extends Activity {
    private EditText ed;
    private ListView lv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ed = (EditText) findViewById(R.id.ed);
        lv = (ListView) findViewById(R.id.list);
        DownloadWebPageTask task = new DownloadWebPageTask();
        task.execute(new String[] { "http://abc.com/default.aspx?id=G" });
    }

    private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
        @Override
        protected String doInBackground(String... urls) {
            String response = "";
            for (String url : urls) {
                DefaultHttpClient client = new DefaultHttpClient();
                HttpGet httpGet = new HttpGet(url);
                try {
                    HttpResponse execute = client.execute(httpGet);
                    InputStream content = execute.getEntity().getContent();

                    BufferedReader buffer = new BufferedReader(
                            new InputStreamReader(content));
                    String s = "";
                    while ((s = buffer.readLine()) != null) {
                        response += s;
                    }

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return response;
        }

        @Override
        protected void onPostExecute(String result) {
            int sub = result.lastIndexOf('@', result.length() - 1);
            String s1 = result.substring(0, sub);
            String s = s1.replace(";", " - ");
            String arr[] = s.split("@");    
            lv.setAdapter(new ArrayAdapter<String>(ReadWebpageAsyncTask.this,
                    android.R.layout.simple_list_item_1, arr));
        }
    }
}

PLEASE CHECK THIS LINK

nullPointerException in multi column list


It is very hectic using multi column list this way. Instead I tried this and it worked..

  • 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-27T05:57:23+00:00Added an answer on May 27, 2026 at 5:57 am

    Use android table layout

    Reference

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

Sidebar

Related Questions

Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: Resetting a multi-stage form with jQuery Once the form submitted, response from
Possible Duplicate: Why do I get a null pointer exception from TabWidget? I have
Possible Duplicate: Python urllib2 Progress Hook I have a script which uploads a file
Possible Duplicate: Getting JavaScript object key list How to iterate json data in jquery
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: Parsing text in C Say I have written to a text file
Possible Duplicate: Multiple forms on ASP.NET page i have a doubt. can we place

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.