I have a ExpandableListView in which i am loading my custom views having 3 edit text fields.
After entering the values into those edit texts,
i am clicking back to minimize the soft keyboard.
That time the text in the edit boxes is disappearing Why..?
If anybody have any idea please help me..?
This is my getGroupView method of ExpandableListView
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
System.out.println("Position = " + groupPosition);
if (groupPosition == 0) {
if (firstTime) {
convertView = inflater.inflate(R.layout.pay_credit_card,
parent, false);
checkBox1 = (Button) convertView.findViewById(R.id.check_box);
email = (EditText) convertView.findViewById(R.id.email);
phone1 = (EditText) convertView.findViewById(R.id.ph);
phone2 = (EditText) convertView.findViewById(R.id.phone);
checkBox1.setOnClickListener(headListener);
firstTime = false;
} else {
emailSt = email.getText().toString();
phone1St = phone1.getText().toString();
phone2St = phone2.getText().toString();
convertView = inflater.inflate(R.layout.pay_credit_card,
parent, false);
checkBox1 = (Button) convertView.findViewById(R.id.check_box);
email = (EditText) convertView.findViewById(R.id.email);
phone1 = (EditText) convertView.findViewById(R.id.ph);
phone2 = (EditText) convertView.findViewById(R.id.phone);
checkBox1.setOnClickListener(headListener);
email.setText(emailSt);
phone1.setText(phone1St);
phone2.setText(phone2St);
}
return convertView;
} else {
View v = null;
v = inflater.inflate(R.layout.pay_group_head, parent, false);
String gt = (String) getGroup(groupPosition);
TextView tv2 = (TextView) v.findViewById(R.id.tvGroup);
if (gt != null && tv2 != null)
tv2.setText(gt);
return v;
}
}
Thanks in advance…!
As already posted as comment:
In order to solve the problem of vanishing textinput, you need to save the textinput directly to some kind of string-array or similar which allows the ListView to retreive the data when it reloads the table
Glad I could help