title: Adding items to the top of a dynamic listview in Android
body: <p>I am new to android and not a killer in programming. I am trying to implement a dynamic listview in which items must be added to the top, rather than getting added to the bottom by default. Is there a way to achieve this? Below is the code I used to create a dynamic listview. Please help!</p>
  
  <pre><code>private void populateListView() {
  
              Cursor cursor = myDb.getAllRows();
              startManagingCursor(cursor);
              String[] fromFieldNames = new String[] 
                      {DBadapter.KEY_FIELD1,DBadapter.KEY_FIELD2};
              int[] toViewIDs = new int[]
                      {R.id.field1,R.id.field2};
  
              SimpleCursorAdapter myCursorAdapter = 
                      new SimpleCursorAdapter(
                              this,
                              R.layout.inner_list_view,
                              cursor,
                              fromFieldNames,
                              toViewIDs
                              );
              ListView myList = (ListView) findViewById(R.id.sampleList);
              myList.setAdapter(myCursorAdapter);
              myCursorAdapter.notifyDataSetChanged();
  }
  </code></pre>