如何禁用列表视图中的项目?

我有一个列表视图,通过数据库中的logging填充。 现在我不得不做一些logging可见,但无法select,我怎么能实现呢?

这是我的代码

public class SomeClass extends ListActivity { private static List<String> products; private DataHelper dh; public void onCreate(Bundle savedInstanceState) { dh = new DataHelper(this); products = dh.GetMyProducts(); /* Returns a List<String>*/ super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.myproducts, products)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener( new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub Toast.makeText(getApplicationContext(), ((TextView) arg1).getText(), Toast.LENGTH_SHORT).show(); } }); } } 

布局文件myproducts.xml如下所示:

 <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dp" android:textSize="16sp"> </TextView> 

Solutions Collecting From Web of "如何禁用列表视图中的项目?"