I am fetching all menunames from server database through url i append all menunames into editext customized listview using base adapter. now i am getting Edittext changed values into list array .now i want store edittext all values, whether he changes menunames or not.Eg:x,yz... menunames coming from database append to the editext now i am changed menuname y to b and z to c in editext.now i want [x,b.c...] vaules in arraylist but now i am getting b,c
this is my code
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = inflater.inflate(R.layout.editmainmenulist, null);
holder.caption = (EditText) convertView
.findViewById(R.id.editmaimenu);
holder.caption1=(ImageView) convertView.findViewById(R.id.menuimage);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
//Fill EditText with the value you have in data source
holder.caption.setText(itemnames[position]);//here only i append database menunames
holder.caption.setId(position);
holder.caption1.setImageBitmap(bmps[position]);
//we need to update adapter once we finish with editing
holder.caption.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus){
final int position = v.getId();
final EditText Caption = (EditText) v;
itemnames[position] = Caption.getText().toString();
arr.add(Caption.getText().toString());//here only i think problem..please see any body can tell what i have mistake has been done
}
}
});
return convertView;
}
}
class ViewHolder {
EditText caption;
ImageView caption1;
}
class ListItem {
String caption;
}
i want all edittext values in whether the editext values change or not. for update purpous. i can get all menunames previous . i want update old menunames into new menunames