Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android使用arrayadapter中定义的字符串从listview中删除项_Android_String_Listview_Android Arrayadapter - Fatal编程技术网

android使用arrayadapter中定义的字符串从listview中删除项

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 } 我想从

我想从我的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
  }
我想从我的arrayadapter中删除里面的项目。我首先通过设置行视图(
final View rowView=inflater.inflate(R.layout.list_item,parent,false);
)不可见,并使用
rowView.setVisibility(View.GONE)但是列表项之间总是有一个空格。但是现在我的问题是为什么我可以从适配器中删除该项


我希望有人能帮我解决这个问题。

首先,你必须使用
.equals(你的字符串)
而不是
=
来处理字符串

然后,要删除项目,必须在从数据库中删除元素后重新计算光标