I need help, guys.
You need to flip the listView so that the new record is displayed at the top, and the oldest is at the bottom.
Example:
Original listView:
Apple Pear Banana
It is necessary so:
Banana Pear Apple
DataBaseHelper dataBaseHelper = new DataBaseHelper(this);
SQLiteDatabase db = dataBaseHelper.getReadableDatabase();
Cursor cursor = db.query(
DataBaseHelper.TABLE_NAME,
null,
null,
null,
null,
null,
null);
String[] args = new String[] {DataBaseHelper.COLUMN_DATE, DataBaseHelper.COLUMN_APPLE,
DataBaseHelper.COLUMN_PEAR, DataBaseHelper.COLUMN_BANANA};
int[] tv_laoyout = new int[] {R.id.tvl_date, R.id.tvl_milliage, R.id.tvl_fueltrip, R.id.tvl_cashtrip};
SimpleCursorAdapter simpleCursorAdapter = new SimpleCursorAdapter(getBaseContext(),R.layout.layout_listview,
cursor, args, tv_laoyout, 0);
ListView myList = (ListView)findViewById(R.id.listview);
myList.setAdapter(simpleCursorAdapter);
db.close();
cursor.close();