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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:18:06+00:00 2026-05-25T10:18:06+00:00

Hi its my first post here nad my first a little bit more advanced

  • 0

Hi its my first post here nad my first a little bit more advanced app for my Android phone… I know that this subject was mentioned here, google knows many examples, however they are not exacty what im looking form ;(

I admit I’m a n00000b… in terms of Android coding… I started… ust few days ago, please forgive me 🙂

The problem is that my listview element is not beeing populated. App compiles and runs without errors, BUT it doesnt lunch getView. From what i have read on the web… I need this to display my beloved listview with its content…

Please help 🙂

    package com.test.stackParser;

    public class StackParserActivity extends Activity {
/** Called when the activity is first created. */
private ProgressDialog pd;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //final TextView tv = (TextView) findViewById(R.id.textView1);
    //tv.setMovementMethod(new ScrollingMovementMethod());

    Button button = (Button)findViewById(R.id.button1);
    button.setOnClickListener(myListener);
}

private OnClickListener myListener = new OnClickListener() {
    public void onClick(View v) {
        pd = ProgressDialog.show(StackParserActivity.this, "Working...", "request to server", true, false);
        new ParseSite().execute("http://multikino.pl/pl/repertuar/warszawa-ursynow/2011-09-02/");
    }
};

private class ParseSite extends AsyncTask<String, Void, List<String>> {

    protected List<String> doInBackground(String... arg) {
        List<String> output = new ArrayList<String>();

        try
        {
            HtmlHelper hh = new HtmlHelper(new URL(arg[0]));
            List<TagNode> links = hh.getLinksByClass("title");

            for (Iterator<TagNode> iterator = links.iterator(); iterator.hasNext();)
            {
                TagNode divElement = (TagNode) iterator.next();
                output.add(divElement.getText().toString());
            }
            Log.d("dupa", "siteParsed");
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }

        return output;
    }

    protected void onPostExecute(List<String> output) {

        pd.dismiss();
        Log.d("dupa", "postExecute");
        ListView listview = (ListView) findViewById(R.id.listViewData);
        //listview.setAdapter(new ArrayAdapter<String>(StackParserActivity.this, android.R.layout.simple_list_item_1 , output));
        MyAdapter dupa = new MyAdapter(StackParserActivity.this, android.R.layout.simple_list_item_1, R.id.movieTitle, output); 
        dupa.notifyDataSetChanged();
        listview.setAdapter(dupa);
        dupa.notifyDataSetChanged();

    }
}

private class MyAdapter extends ArrayAdapter<string> {

    String[] tabObj;

    public MyAdapter(Context context, int resource, int textViewResourceId, List<String> output) {
        super(context, resource, textViewResourceId);
        tabObj = output.toArray(new String[]{});

        Log.d("dupa", tabObj[2].toString());
        notifyDataSetChanged();
        // TODO Auto-generated constructor stub
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        Log.d("dupa", "!!!!getView");

        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View row = inflater.inflate(R.layout.row_layout,parent,false);
        TextView tv = (TextView) row.findViewById(R.id.movieTitle);         

        tv.setText(tabObj[position]);

        //Button buton1 = (Button) row.findViewById(R.id.buttonInfo);
        //Button button2 = (Button) row.findViewById(R.id.buttonReserve);

        return super.getView(position, convertView, parent);
    }
};

}

  • 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-25T10:18:07+00:00Added an answer on May 25, 2026 at 10:18 am

    Return row from getView method. Also remove the notifyDatasetChanged() from the MyAdapter constructor.

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        Log.d("dupa", "!!!!getView");
    
        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View row = inflater.inflate(R.layout.row_layout,parent,false);
        TextView tv = (TextView) row.findViewById(R.id.movieTitle);         
    
        tv.setText(tabObj[position]);
    
        //Button buton1 = (Button) row.findViewById(R.id.buttonInfo);
        //Button button2 = (Button) row.findViewById(R.id.buttonReserve);
    
        return row;
    }
    

    EDIT :
    Try overriding getCount in adapter where you return the size() of tabObj

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

Sidebar

Related Questions

This is my first post on here.. I'm writing a program in MVC3 that
This is my first post in stackoverflow. I want to improve its google pagerank
The first part of this question is now its own, here: Analyzing Text for
this is my first post here. First off, some background, I'm new to C#
this is my first post here! I'm trying to make a windows forms program
It's my first post here, on this greet website. I'm an experienced C#, .Net
This is my first post here and as I am at my wits end
I have seen this post here (http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state). I am having a similar problem I
this is my first post here but I've been a frequent reader of various
that's my first post here. I have problem with managing activities. I have my

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.