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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:54:19+00:00 2026-05-20T22:54:19+00:00

I have to display data from the database in a listview. I have fetch

  • 0

I have to display data from the database in a listview. I have fetch all the data in alphabetical order and displayed in a Listview. I have used the following code.

private ListView infos;


@Override
public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);
  .........
  .........
  infos = new ListView(this);
  model = infoDataHelper.getCursor(addType);
  adapter = new InfoAdapter(model);
  infos.setAdapter(adapter);
  .........
  .........
}


class InfoAdapter extends CursorAdapter {

  public InfoAdapter(Cursor c) {
    super(getParent(), c);
    // TODO Auto-generated constructor stub
  }

  @Override
   public void bindView(View row, Context ctxt, Cursor c) {
    InfoHolder holder = (InfoHolder) row.getTag();
    holder.populateTable(c, infoDataHelper);
   }

   @Override
   public View newView(Context ctxt, Cursor c, ViewGroup parent) {

    LayoutInflater inflater = getLayoutInflater();

    View row;
        row = inflater.inflate(R.layout.inforow, parent, false);

    InfoHolder holder = new InfoHolder(row);
    row.setTag(holder);
    table_id++;
    return (row);
   }

}

Now I want to add heading A-Z on result set so that it looks like that-

A
Apple
Android
Ass
B
Ball
Bolt

and so on..

How can I make it? Does the addHeaderView work for it? If it is, How I can add it?

  • 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-20T22:54:20+00:00Added an answer on May 20, 2026 at 10:54 pm

    For this we are having AlphabetIndexer that seperate lists values by alphabetic order..

    Check this link Alphabetic Indexer….

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

Sidebar

Related Questions

Many applications have grids that display data from a database table one page at
Let's say you have a form with a component that displays data from a
I have a UIViewController that manages the display of some data. When the user
In my application I have a DataGridView control that displays data for the selected
I have a Rails app with some basic models. The website displays data retrieved
I have to display yes/no button on some condition on my asp.net page ,
I have to display a column chart in a user form in VBA. Exporting
I'm looking to have text display vertically, first letter at the bottom, last letter
Seems likes it might be useful to have the assert display a message when
I have a need to display a UITableView containing a user's account credentials. For

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.