在提出问题并花了15天时间来解决这个问题后,我再次寻求帮助和解决方案.在MainActivity中,我创建了Json下载任务,它从http下载数据,并使用CustomListAdapter.class填充listview.一切正常.现在,在listview中我有2个textview,我想要点击,其中一个是"Accept",textview只是在xml中,它没有填充Adapter或Json."接受"应该像这样工作"将文本更改为已接受并更改颜色",其工作方式与其他所有内容相同.但是当我点击列表视图中的第一个"接受"(位置0)时,它会更改其他列表视图项目(位置4,9).这就像我点击了位置4,9上的文本视图.在第一张图片上点击"接受"之前,第二张图片是点击之后.
///

public class MainActivity extends Activity {
protected static final String TAG = null;
public ArrayList<FeedItem> feedList;
public ListView feedListView;
private ProgressBar progressbar;
private CustomListAdapter adap;
private LayoutInflater mInflater;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
feedListView= (ListView) findViewById(R.id.custom_list);
mInflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
String url = "...";
new DownloadFilesTask().execute(url);
getActionBar().setIcon(R.drawable.angel);
progressbar = (ProgressBar)findViewById(R.id.progressBar);
public void updateList() {
adap = new CustomListAdapter(this, feedList);
feedListView.setAdapter(adap);
}
public class DownloadFilesTask extends AsyncTask<String, Integer, Void> {
///....
Run Code Online (Sandbox Code Playgroud)
CustomListAdapter.class
public class CustomListAdapter extends …Run Code Online (Sandbox Code Playgroud)