给出下面的代码来更新 listview
中的当前行,但是列表没有得到更新,如果我的代码有任何错误,请告诉我
private void update(int id)
{
int c = subaccountview.getChildCount();
for (int i = 0; i < c; i++)
{
View view = subaccountview.getChildAt(i);
// if (view.getTag() == id)
// {
TextView someText = (TextView) view.findViewById(R.id.balancenamenew);
someText.setText(Sessiondata.getInstance().getRbalvalue());
jsonCustomAdapter.notifyDataSetChanged();
// }
// update view
}
}
最佳答案
只需将通知更改为:
jsonCustomAdapter.notifyItemChanged(i) // i will be the position on which data is changed
关于android - 无法更新当前行 ListView ,我的代码在下面给出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41356666/