Keyboard does not recognize Edittext

Asked

Viewed 237 times

9

I have several EditText inside an item on my list ExpandleListView.
Always by clicking on EditText appears the message below and is not typed text in the field:

getSelectedText on inactive Inputconnection
getTextBeforeCursor on inactive Inputconnection
getTextBeforeCursor on inactive Inputconnection

public View buscaView(int groupPosition){
        if(listaHolder.size() > 0){
            for(int i = 0; i < listaHolder.size(); i++){
                if(listaHolder.get(i).position == groupPosition){
                    return listaHolder.get(i).convertView;
                }
            }
        }
        return null;
    }

 @Override
    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {

        if(buscaView(groupPosition) == null) {
               LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(
                        Context.LAYOUT_INFLATER_SERVICE);
                convertView = layoutInflater.inflate(R.layout.adapter_aneurisma, null);

                holder = new ItemSuporte();
                // Editexts
                holder.aneurismaLargura = (EditText) convertView.findViewById(R.id.et_largura);
                holder.aneurismaComprimento = (EditText) convertView.findViewById(R.id.ed_comprimento);
                holder.ed_colo = (EditText) convertView.findViewById(R.id.ed_colo);
                holder.ed_causa = (EditText)  convertView.findViewById(R.id.ed_causa);
                holder.ed_descricao = (EditText) convertView.findViewById(R.id.ed_descricao);
                holder.ed_tratamento = (EditText)  convertView.findViewById(R.id.ed_tratamento);
                holder.ed_resultado_imediato = (EditText)  convertView.findViewById(R.id.ed_resultado_imediato);
                holder.ed_n_clips = (EditText) convertView.findViewById(R.id.ed_n_clips);
                holder.ed_tempo_clipagem_temporaria = (EditText) convertView.findViewById(R.id.ed_tempo_clipagem_temporaria);
                holder.ed_n_coils = (EditText) convertView.findViewById(R.id.ed_n_coils);
                holder.ed_descricao_complicacoes_especificas = (EditText) convertView.findViewById(R.id.ed_descricao_complicacoes_especificas);

                // Checkbos
                holder.cb_insucesso_terapeutico = (CheckBox) convertView.findViewById(R.id.cb_insucesso_terapeutico);
                holder.cb_paralisia_incompleta = (CheckBox) convertView.findViewById(R.id.cb_paralisia_incompleta);
                holder.cb_paralisia_completa = (CheckBox) convertView.findViewById(R.id.cb_paralisia_completa);
                holder.cb_clipagem_temporaria = (CheckBox) convertView.findViewById(R.id.cb_clipagem_temporaria);
                holder.cb_balao = (CheckBox) convertView.findViewById(R.id.cb_balao);
                holder.cb_stent = (CheckBox) convertView.findViewById(R.id.cb_stent);
                holder.cb_complicacoes_especificas_procedimento = (CheckBox) convertView.findViewById(R.id.cb_complicacoes_especificas_procedimento);

                // View
                holder.conainner = (View) convertView.findViewById(R.id.container);

                //holder.convertView = convertView;
                holder.position = groupPosition;
                holder.convertView = convertView;
                //holder.convertView.setTag(holder);

                // Adicionando cada view  do ExpandleListView.
                listaHolder.add(holder);

                Log.e("Adapter", "Criou uma nova instância da View...");

        }
        else{
           Log.e("Adapter","Retornou uma instância existente..., Total de holders: " + listaHolder.size());
           holder = (ItemSuporte) buscaView(groupPosition).getTag();
        }

         return buscaView(groupPosition);
    }
  • Could you post the part of your code where you make the declaration and initialization of Edittexts? I think it would help solve this problem faster.

  • I put the code

  • The problem is that my Edittext loses focus.

1 answer

-1

Expandlelistview is very buggy, I ended up using a common Listview that was identical to Expandle... Hiding and showing the layout at each click to "expand" the list item, as well as the manipulation of the Up and Down arrow at each "opening" of the list. It was identical to Expandlelistview only without bugs, I recommend it to those who use this approach.

Hug.

  • 3

    even if your answer is correct, it is advisable to add to it a code for better understanding, because there are many people starting in the android world and do not have a clue what Voce is talking about.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.