我开发了一个从SQLite获取数据的自定义适配器。数据正在选择,适配器也获取数据。我打印数据进入适配器。 我想让listview可索引并添加快速滚动。
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ouvagedisplay_list);
if (findViewById(R.id.ouvagedisplay_detail_container) != null) {
mTwoPane = true;
((OuvageDisplayListFragment) getSupportFragmentManager()
.findFragmentById(R.id.ouvagedisplay_list))
.setActivateOnItemClick(true);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
db = new MySQLiteHelper(getActivity());
initList();
SimpeAdapterOuvrages = new SimpeAdapterOuvrages(list,getActivity());
setListAdapter(SimpeAdapterOuvrages);
}
activity_ouvagedisplay_list.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal"
android:showDividers="middle"
tools:context=".OuvageDisplayListActivity" >
<fragment
android:id="@+id/ouvagedisplay_list"
android:name="fr.artinove.OuvageDisplayListFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
tools:layout="@android:layout/list_content" />
<FrameLayout
android:id="@+id/ouvagedisplay_detail_container"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3" />