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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:03:20+00:00 2026-05-30T07:03:20+00:00

For my application I am using a couple listview. So far have been using

  • 0

For my application I am using a couple listview. So far have been using simplecursoradapter and works great except for my list view that has a TextView and EditText in the row. I’ve run into problems that others have had, such as pulling the data from edittext to use in another activity as well as on scroll the text jumps around to different fields due to recycling. After research seems the best way to over come this is to build a custom cursor adapter but I can’t wrap my head around how to do this.

public void fillData() {
    Cursor e = mydbhelper.getUserWord();
        startManagingCursor(e);
        String[] from = new String[] {dbadapter.KEY_USERWORD,};
        int[] to = new int[] {R.id.textType,};
       editadapter = new SimpleCursorAdapter(this, R.layout.edit_row, e, from, to);
       ListView list = getListView();
       View footer = getLayoutInflater().inflate(R.layout.footer_layout, list, false);
       list.addFooterView(footer);
       setListAdapter(editadapter);

This is what I use for the activity in question but I can’t understand how this would fill into a custom cursor adapter.

Also not sure if this custom adapter should be in a separate class from the rest of my code (like my menu items, edittext validator, onclick events etc.) and call the custom at the start of the class for everything else.

EDIT
Was able to figure out what I needed from http://www.vogella.de/articles/AndroidListView/article.html#overview

not sure how I didn’t come across it earlier but it helped me build a base to work off of. TY for all the help. I feel like I have ALOT better understand of how custom cursor adapters work.

  • 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-30T07:03:22+00:00Added an answer on May 30, 2026 at 7:03 am

    Try a custom adaptor instead of custom cursor adaptor
    …

      public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.addnew);
    
        ItemsAdapter itemsAdapter = 
            new ItemsAdapter(AddNew.this, R.layout.addnew_typelist_row, types);
    
        listtype.setAdapter(itemsAdapter);
    }
    
    public class ItemsAdapter extends BaseAdapter {
        ArrayList<String> items = new ArrayList<String>();
        String type;
        int color;
        ViewHolder holder;
        Context context;
        int resID;
    
        public ItemsAdapter(Context context, int resID, ArrayList<String> items) {
            this.items = items;
            this.context = context;
            this.resID=resID;
        }
    
        public View getView(final int position, View convertView, 
            ViewGroup parent) {
    
            View v = convertView; 
            TextView name = null ;
    
            if(convertView == null) {
                LayoutInflater inflater = LayoutInflater.from(context);
                v = inflater.inflate(resID, null);
    
                holder=new ViewHolder();
                holder.lt = (RelativeLayout)v.findViewById(R.id.ltlistrow);
                holder.name = (TextView)v.findViewById(R.id.desc);
    
                v.setTag(holder);
    
            } else {
                holder = (ViewHolder)v.getTag();
                v = convertView;
            }
    
            String nam = items.get(position);
            if (nam != null) {
                holder.name.setText(items.get(position));
            }
    
            return v;
        }
    
        public static class ViewHolder{
            TextView name;
            RelativeLayout lt ;
        }
    }
    

    Custom adapter can be in new class or can be a inner class. inflate a layout with the edit text and set it as the list item in the getView. hope it helps

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

Sidebar

Related Questions

I have couple resource DLLs that I currently load when application starts using following
I have a server hosting a remoting application using .NET 3.5. It has been
I have a jsp application (using Spring) that uses a couple of global variables.
I have created a simple API for a Rails application using token-based-authentication that supports
I have a Struts based web application that has a structure similar to the
I have a WinForms application (I'm using VB) that can be minimized to the
I have an MFC application (using a legacy library that I can't change). When
Recently I have been tasked with creating an application for a business that basically
I have a fairly simple application using Core Data, and a couple Array Controllers
I have a WPF/C# application that is using the MVVM light framework. When it

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.