4
public void onClick(View v) {

                        linearparent = (LinearLayout) v.getParent(); // first
                        // parent

                        linearparent.setFocusable(true);

                        top_parent = (RelativeLayout) linearparent
                                .getParent(); // top parent

                        gateway_list_name_edit_text = (EditText) top_parent
                                .findViewById(R.id.gateway_list_name_text_view_temp);

                        if (v.getTag() == null) {
                            v.setTag(true);
                            v.setBackgroundResource(R.drawable.on);

// top_parent.setDescendantFocusability(ViewGroup.FOCUSABLES_TOUCH_MODE); // make edit text nomral gateway_list_name_edit_text .setBackgroundResource(android.R.drawable.editbox_background);

                            gateway_list_name_edit_text
                                    .setTextColor(Color.BLACK);
                            gateway_list_name_edit_text
                                    .setCursorVisible(true);
                            gateway_list_name_edit_text.setFocusable(true);
                            gateway_list_name_edit_text.requestFocus();
                            // gateway_list_name_edit_text.setText("hello");
                            gateway_list_name_edit_text.setEnabled(true);

                        } else {
                            v.setBackgroundResource(R.drawable.white_info);
                            v.setTag(null);
                            top_parent
                                    .setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
                            // make edit text like textview
                            gateway_list_name_edit_text
                                    .setBackgroundColor(Color.TRANSPARENT);

                            gateway_list_name_edit_text
                                    .setTextColor(Color.WHITE);

                        }

                        // notifyDataSetChanged();
                    }

                });
Pihu
  • 1,041
  • 11
  • 35
Deepak
  • 1,669
  • 1
  • 18
  • 28
  • when i remove descendantFocusbility its working but problem is then item is not clicked. please tell me the solution in case both will work?? help me pls – Deepak Feb 20 '14 at 04:23

0 Answers0