0
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                          
            }
        });

if inputSearch = "India Gate" after India the later word after space shows but if i type G after space the reult hides automatically.

0 Answers0