I use my ArrayAdapter expanded getView method. I change CheckBox but the ListView does not refresh
my source
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// Planet to display
UrlItem urlItem = (UrlItem) this.getItem(position);
ViewHolder viewHolder = null;
if (convertView == null) {
convertView = inflater.inflate(R.layout.database_table_item, null);
viewHolder = new ViewHolder();
viewHolder.checkbox = (CheckBox) convertView
.findViewById(R.id.checkBox1);
viewHolder.checkbox
.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
int getPosition = (Integer) buttonView.getTag();
DatabaseTable.setPosition(getPosition);
for (int i = 0; i < UrlItems.size(); i ++ ) {
UrlItems.get(i).setUse(false);
}
UrlItems.get(getPosition).setUse(isChecked);
}
});
How can I refresh the list after changes ??
for your information in the manifest set
<activity
android:name=".DatabaseTable"
android:label="database_table" android:windowSoftInputMode="adjustPan" >
See the link for the upgrade using the button "selectAll" I have exact same idea but without the button selectAll
http://pastebin.com/PgNeDnXq