【发布时间】:2014-08-05 09:05:09
【问题描述】:
我想将 listview 的顺序更改为最近添加的项目在 listview 的顶部,旧的是最后一个
我从 sqlite 获取数据,然后将它们填充到名为 reports_items_obj 的对象的数组列表中 我使用自定义适配器查看
ListView list_messages = (ListView) findViewById(R.id.list);
Report_adapter adapter = new Report_adapter(getApplicationContext(), reports_items_obj);
list_messages.setAdapter(adapter);
xml file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/list"
android:layout_height="wrap_content"
android:layout_width="match_parent">
</ListView>
</LinearLayout>
【问题讨论】: