在我的應用程序,我使用此代碼顯示列表視圖與科。 但這種方式我不能得到那個該列表項,我要選擇。我的意思是,當我要按任何列表項目時,我無法看到變色。因此,如何有可能使該代碼:爲什麼我無法顯示列表視圖被點擊?如何讓它成爲可能?
public static ProgressDialog m_progressDialog;
public Map<String,?> createItem(String title, String caption) {
Map<String,String> item = new HashMap<String,String>();
item.put(ITEM_TITLE, title);
item.put(ITEM_CAPTION, caption);
return item;
}
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
// create our list and custom adapter
SeparatedListAdapter adapter = new SeparatedListAdapter(this);
adapter.addSection("Local documents:", new ArrayAdapter<String>(this,
R.layout.list_item, new String[] { "WindowsONE Mobile PK", "WindowsorONE Moldings","Filet for a burger video" }));
adapter.addSection("Non-local resources:", new ArrayAdapter<String>(this,
R.layout.list_item, new String[] { "Launch Photo slideshow link", "Dealer locator link" }));
adapter.addSection("Send emails:", new ArrayAdapter<String>(this,
R.layout.list_item, new String[] { "Send Dealer Locator email", "Send Catalog email","Send install instrucation link" }));
//For extra Information in Listview
//adapter.addSection("Non-local resources:", new SimpleAdapter(this, security, R.layout.list_complex,
//new String[] { ITEM_TITLE, ITEM_CAPTION }, new int[] { R.id.list_complex_title, R.id.list_complex_caption }));
ListView list = getListView();
list.setAdapter(adapter);
list.setTextFilterEnabled(true);
list.setOnItemClickListener(this);
}
}
我想我必須使用Customadapter或圖像適配器。但我很困惑,如何實現這個靜態值。那麼請讓anybudy幫我實現這個代碼? –