用你的
importContacts()方法
你做 :
txtName.setText(Name.get(0)); txtPhone.setText(Phone.get(0)); txtMobile.setText(Mobile.get(0)); txtAddress.setText(Address.get(0));
而不是
.get(0)我认为应该
.get(index)根据您的代码
- 编辑 -
或者避免在此处重新导入您的联系人,您的previous()方法应为:
public void Previous() { if (index > 0) { index--; } txtName.setText(Name.get(index)); txtPhone.setText(Phone.get(index)); txtMobile.setText(Mobile.get(index)); txtAddress.setText(Address.get(index)); } public void Next() { if(index < temp.size() - 1){ index++; } txtName.setText(Name.get(index)); txtPhone.setText(Phone.get(index)); txtMobile.setText(Mobile.get(index)); txtAddress.setText(Address.get(index)); }-最终编辑,pastebin中的代码源可用



