android使用arrayadapter中定义的字符串从listview中删除项
我想从我的listview中删除一些项目,它们有一个我定义的字符串 我的arrayadapter:android使用arrayadapter中定义的字符串从listview中删除项,android,string,listview,android-arrayadapter,Android,String,Listview,Android Arrayadapter,我想从我的listview中删除一些项目,它们有一个我定义的字符串 我的arrayadapter: if (dayx[0] == "day1"){ if (thisday) { daynotempty(rowView, textView, textView2, imageView1); }else{ remove this item //here he must remove the item in array adapter } 我想从
if (dayx[0] == "day1"){
if (thisday) {
daynotempty(rowView, textView, textView2, imageView1);
}else{
remove this item //here he must remove the item in array adapter
}
我想从我的arrayadapter中删除里面的项目。我首先通过设置行视图(final View rowView=inflater.inflate(R.layout.list_item,parent,false);
)不可见,并使用rowView.setVisibility(View.GONE)代码>但是列表项之间总是有一个空格。但是现在我的问题是为什么我可以从适配器中删除该项
我希望有人能帮我解决这个问题。首先,你必须使用.equals(你的字符串)
而不是=
来处理字符串
然后,要删除项目,必须在从数据库中删除元素后重新计算光标