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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:20:16+00:00 2026-05-25T20:20:16+00:00

I am running the software but when i scroll with the listview, its showing

  • 0

I am running the software but when i scroll with the listview, its showing ok, but after a while i get this error message:

I am trying to display a cursor to a listview.

My Adapter class:

  private class DBAdapter extends SimpleCursorAdapter {
        private LayoutInflater mInflater;
        private Cursor c;
        private Context context;

My Constructor

        public DBAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
            super(context, layout, c, from, to);
            this.c = c;
            this.context = context;
            mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        }

getView Method

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ViewHolder holder = null; 
            if (convertView == null) {
                holder = new ViewHolder();
                convertView = mInflater.inflate(R.layout.match_item, null);
                holder.tvHome = (TextView)convertView.findViewById(R.id.ll_home);
                convertView.setTag(holder);
            } else {
                holder = (ViewHolder)convertView.getTag();
            }
                holder.tvHome.setText(c.getString(3)+"("+c.getString(6)+")");
                c.moveToNext();
                return convertView; 
        }
    }

Simple View Holder

    public static class ViewHolder {
        public TextView tvHome;
    }
}

Adapter init

Cursor cur = dh.getAll();
    startManagingCursor(cur);

    String[] from = new String[] { "home" };
    int[] to = new int[] { R.id.ll_home};

    // Now create an array adapter and set it to display using our row
    DBAdapter matches = new DBAdapter(this,R.layout.match_item, cur, from, to);
    setListAdapter(matches);

Can anyone help me to solve this problem?I’ve searched everywhere but i could not find any solution

Best regards,
Nicos

  • 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-25T20:20:17+00:00Added an answer on May 25, 2026 at 8:20 pm

    you’re supposed to override newView and bindView when implementing your own cursor adapter, not getView. i found this: Trying to override getView in a SimpleCursorAdapter gives NullPointerExceptio

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

Sidebar

Related Questions

Running into a problem where on certain servers we get an error that the
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled
Hi have a problem running my software on the samsung galaxy tab. Sometimes (but
My custom homebrew photography processing software, running on 64 bit Linux/GNU, writes out PNG
Running a ServiceHost with a single contract is working fine like this: servicehost =
Running ipconfig /all shows a Teredo Tunneling Pseudo-Interface. What is that? Does this have
I have a piece of running java software that is jammed. I would like
I've got a software running on Linux that is leaking memory. It's an embedded
I'm trying to fix a problem with an application that sends a message to
Where I'm at we have a software package running on a mainframe system. The

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.