Android中的多个单词String的简单适配器问题

时间:2014-09-12 06:58:34

标签: android

inputSearch.addTextChangedListener(new TextWatcher() {
            @Override
            public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {
                // When user changed the Text
                ParseXMLDemo.this.adapter1.getFilter().filter(cs.toString().trim());   

                if(list2.getVisibility() == View.INVISIBLE)
                    list2.setVisibility(View.VISIBLE);


                list2 = (ListView) findViewById(R.id.list2);
                if(inputSearch.getText().toString().equals(""))
                {
                    list2.setVisibility(View.INVISIBLE);
                    text.setVisibility(View.VISIBLE);
                }
                else
                {
                    list2.setVisibility(View.VISIBLE);
                    text.setVisibility(View.INVISIBLE);
                }
            }
            @Override
            public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                    int arg3) {

                  }
              @Override
            public void afterTextChanged(Editable arg0) {
                // TODO Auto-generated method stub                          
            }
        });

如果inputSearch =“India Gate” 在印度之后,空间显示后的后一个词,但如果我在空格后键入G,则reult会自动隐藏。

0 个答案:

没有答案