我有一个ListView.它的每一行包含3 TextView和2 Button.在它上面我有一个EditText.如何按每行ListView第一TextView行的值过滤我的?
我正在开发一个Android 3.1应用程序.
我有自定义ArrayAdapter.我想在ListView中显示名称列表.
这些名称是可以下载并在本地保存的表单.当用户下载并保存一个或多个时,我打电话updateFormsNotDownloaded().但是当我这样做时,我得到一个IndexOutOfBoundsException.我认为这个问题是因为我打电话notifyDataSetChanged().
看看我的代码:
public class FormAdapter extends ArrayAdapter<Form>
{
private Context context;
private int layoutResourceId;
private List<Form> forms;
private ArrayList<Integer> checkedItemsPosition;
private Button downloadButton;
public ArrayList<Integer> getCheckedItemsPosition()
{
return checkedItemsPosition;
}
public String[] getSelectedFormsId()
{
String[] ids = new String[checkedItemsPosition.size()];
int i = 0;
for(Integer pos : checkedItemsPosition)
{
Form f = forms.get(pos.intValue());
ids[i] = f.FormId;
i++;
}
return ids;
}
/**
* Called when selected forms has been downloaded and save it locally …Run Code Online (Sandbox Code Playgroud)