我有一個列表視圖,當它被點擊時,它必須是不可見的。它工作得很好,但當屏幕上下滾動時,再次出現不可見的那些。有誰知道如何解決這些問題。隱藏點擊後的列表視圖
這裏是我的代碼片段爲ListItemClick
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
v.setVisibility(View.GONE);
Object o = this.getListAdapter().getItem(position);
Contact1 c = (Contact1) o;
Toast.makeText(this, c.getDisplayName(),
Toast.LENGTH_SHORT).show();
Toast.makeText(this, c.getId(), Toast.LENGTH_SHORT).show();
ids.add(c.getDisplayName());
}
太感謝你了你的建議的工作完全相同的方式,我想:-) –
@MohanTimilsina好知道.. – ngesh