Note that there are some explanatory texts on larger screens.

plurals
  1. POcustom Expendable List view child
    text
    copied!<p>I have a problem ,I have an expendable list view and the child row is a custom row which contains textViews and Button and a LinearLayout which I want to add a EditText view programaticly when I click on the button in the child view ..</p> <p>I have no problem at this part ,I can add the view when I click on the button ,but my problem is that when I move to another activity from Actionbar tabs the EditText views that I added gone and I couldn't see it again even if I write on it ,and i need to be visible all the time </p> <p>Can any one tell me what is this problem and any way to solve it ASAP ..Please </p> <p>Thank you, </p> <pre><code> @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { // TODO Auto-generated method stub final View rowview =super.getChildView(groupPosition, childPosition, isLastChild, convertView, parent); final EditText item_count=(EditText)rowview.findViewById(R.id.txt_count); Cursor child=getChild(groupPosition,childPosition); item_count.setText(String.valueOf(child.getInt(child.getColumnIndex("quantity")))); // EditText comment=(EditText)rowview.findViewById(R.id.iman); // comment.setText("Add your comment here "); ImageButton btn_add_count=(ImageButton)rowview.findViewById(R.id.btn_add_item); btn_add_count.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub count=Integer.valueOf(item_count.getText().toString()); count=count+1; item_count.setText(String.valueOf( count)); } }); //this is the button which i click to add the views Button btn_add_comment=(Button)rowview.findViewById(R.id.btb_add_comment); btn_add_comment.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub LayoutInflater inflater=LayoutInflater.from(getActivity()); commentLayout=(LinearLayout)rowview.findViewById(R.id.comment_layout); final LinearLayout rowLayout=new LinearLayout(getActivity()); // Button remove=new Button(getActivity()); remove.setText("remove"); remove.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub // int index=rowLayout.getId(); commentLayout.removeView(rowLayout); //rowLayout.setVisibility(View.GONE); Log.i("remove", "this is remove comment"); } }); rowLayout.setOrientation(LinearLayout.HORIZONTAL); EditText comment_text=new EditText(getActivity()); comment_text.setBackgroundColor(Color.WHITE); comment_text.setTextColor(Color.BLACK); comment_text.setWidth(400); comment_text.setHeight(40); rowLayout.addView(remove); rowLayout.addView(comment_text); commentLayout.addView(rowLayout); } }); return rowview; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload