Sectioning Listview
<p>can somebody give me an example on how to section the listview?
im using SimpleCursorAdapter to display the datas in the listview..</p>

<p>my code is like this.</p>

<pre><code>private WordDbAdapter dbHelper;
private SimpleCursorAdapter dataAdapter;
</code></pre>

<p>this are the codes on the onCreate() method.</p>

<pre><code>    dbHelper = new WordDbAdapter(this);
    dbHelper.open();

    //Clean all data
    dbHelper.deleteAllWords();
    //Add some data
    dbHelper.insertSomeWords();

    //Generate ListView from SQLite Database
    displayListView();
</code></pre>

<p>and this is the code outside the onCreate method.</p>

<pre><code>@SuppressWarnings("deprecation")
private void displayListView() {


  Cursor cursor = dbHelper.fetchAllWords();

  // The desired columns to be bound
  String[] columns = new String[] {
          WordDbAdapter.KEY_WORD,

  };

  // the XML defined views which the data will be bound to
  int[] to = new int[] {

    R.id.Word,

  };

  // create the adapter using the cursor pointing to the desired data
  //as well as the layout information
  dataAdapter = new SimpleCursorAdapter(
    this, R.layout.word_info,
    cursor,
    columns,
    to
    );

  ListView listView = (ListView) findViewById(R.id.Diclist);
  // Assign adapter to ListView
  listView.setAdapter(dataAdapter);


  listView.setOnItemClickListener(new OnItemClickListener() {
   @Override
   public void onItemClick(AdapterView&lt;?&gt; listView, View view,
     int position, long id) {
   // Get the cursor, positioned to the corresponding row in the result set
   Cursor cursor = (Cursor) listView.getItemAtPosition(position);


   // Get the word name from this row in the database.
   String wordSelected =
               cursor.getString(cursor.getColumnIndexOrThrow("word"));

       String wordSyllabication =
               cursor.getString(cursor.getColumnIndexOrThrow("syllabication"));
       String wordPartofSpeech =
               cursor.getString(cursor.getColumnIndexOrThrow("partofspeech"));
       String wordMeaning =
               cursor.getString(cursor.getColumnIndexOrThrow("meaning"));

       EditText TextDic = (EditText) findViewById(R.id.TextDic);
       TextDic.setText(wordSelected);


       Toast.makeText(getApplicationContext(),
               wordSyllabication + "\n" + wordPartofSpeech + "\n" + wordMeaning , Toast.LENGTH_SHORT).show();

       }
      });
</code></pre>
