title: Android Search filter is not working properly in gridview?
body: <pre><code>public class ExploreScreenActivity extends Activity implements OnClickListener,         OnItemClickListener,IServerResponse, TextWatcher{
  private ImageButton _refreshBtn=null;
  private ImageButton _searchBtn=null;
  private Button _cancelBtn=null;
  private EditText _searchText=null;
  //  private ExploreGridAdapter mAdapter=null;
  private TextView _exploreTxt=null;
  private LinearLayout _search_all_layout=null;
  private ImageButton _allSearchBtn=null;
  private ImageButton _brandsSearchBtn=null;
  private ImageButton _itemsSearchBtn=null;
  private ImageButton _peopleSearchBtn=null;
  private SharedPreferences _sPrefs=null;
  public ArrayList&lt;Object&gt; _itemList=null;
  private ArrayList&lt;Object&gt;_brandlist=null;
  private ArrayList&lt;Object&gt;_alluserlist=null;
  private ArrayList&lt;Object&gt;_peoplelist=null;
  
  private String type=null;;
  private String searchString=null;;
  private GridView _explorGridView=null;
  
  //private GridSearchNewAdapter adapter=null;
  private GridBrandadapter brandadapter=null;
  private GridAllUserAdapter alladapter=null;
  private GridItemAdapter itemadapter=null;
  private GridUserAdapter useradapter=null;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_explorscreen);
      _sPrefs=getSharedPreferences("myPrefs", Context.MODE_PRIVATE);
      _itemList = new ArrayList&lt;Object&gt;();
      _brandlist=new ArrayList&lt;Object&gt;();
      _alluserlist=new ArrayList&lt;Object&gt;();
      _peoplelist=new ArrayList&lt;Object&gt;();
      _refreshBtn=(ImageButton)findViewById(R.id.refresh_btn);
      _refreshBtn.setOnClickListener(this);
      _search_all_layout=(LinearLayout)findViewById(R.id.search_all_layout);
      _searchBtn=(ImageButton)findViewById(R.id.search_btn);
      _searchBtn.setOnClickListener(this);
      _searchText=(EditText)findViewById(R.id.search_edtTxt);
      _searchText.setOnClickListener(this);
      _cancelBtn=(Button)findViewById(R.id.cancel_btn);
      _cancelBtn.setOnClickListener(this);
      _explorGridView=(GridView)findViewById(R.id.explor_gridView);
      _exploreTxt=(TextView)findViewById(R.id.explor_textView);
      _allSearchBtn=(ImageButton)findViewById(R.id.all_search_btn);
      _allSearchBtn.setOnClickListener(this);
      _brandsSearchBtn=(ImageButton)findViewById(R.id.brands_search_btn);
      _brandsSearchBtn.setOnClickListener(this);
      _itemsSearchBtn=(ImageButton)findViewById(R.id.items_search_btn);
      _itemsSearchBtn.setOnClickListener(this);
      _peopleSearchBtn=(ImageButton)findViewById(R.id.people_search_btn);
      _peopleSearchBtn.setOnClickListener(this);
  
      type= _searchText.getText().toString();
      searchString=_searchText.getText().toString();
      getSearch(type,searchString);
      //_explorGridView.setAdapter(mAdapter);
      _explorGridView.setOnItemClickListener(this);
      _searchText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
          @Override
          public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
              if (actionId == EditorInfo.IME_ACTION_SEARCH) {
                  Intent intent=new Intent(ExploreScreenActivity.this, FeedSelectedActivity.class);
                  TabGroupActivity parentActivity = (TabGroupActivity)getParent();
                  parentActivity.startChildActivity("feedselected", intent);
  
                  return true;
              }
              return false;
          }
      });
      _searchText.addTextChangedListener(this);
  }
  
  
  
  @Override
  public void onClick(View v) {
      TabGroupActivity parentActivity=(TabGroupActivity)getParent();
      Intent intent=null;
      switch (v.getId()) {
      case R.id.refresh_btn:
          break;
      case R.id.search_btn:
  
          _searchText.setText("");
          intent=new Intent(this, FeedSelectedActivity.class);
          parentActivity.startChildActivity("feedselect", intent);
          break;
      case R.id.cancel_btn:
          _exploreTxt.setVisibility(View.VISIBLE);
          _searchBtn.setVisibility(View.VISIBLE);
          _search_all_layout.setVisibility(View.GONE);
          _cancelBtn.setVisibility(View.GONE);
          _searchText.setText("");
          //  _explorGridView.setAdapter(mAdapter);
  
          break;
      case R.id.search_edtTxt:
          _exploreTxt.setVisibility(View.GONE);
          _searchBtn.setVisibility(View.GONE);
          _cancelBtn.setVisibility(View.VISIBLE);
          _search_all_layout.setVisibility(View.VISIBLE);
          break;
      case R.id.all_search_btn:
          _brandsSearchBtn.setBackgroundResource(R.drawable.brand_deselected);
          _itemsSearchBtn.setBackgroundResource(R.drawable.items_deselected);
          _peopleSearchBtn.setBackgroundResource(R.drawable.people_deselected);
          _allSearchBtn.setBackgroundResource(R.drawable.all_selected);
          type="all";
          getSearch( type, searchString);
  
          break;
      case R.id.brands_search_btn:
          _brandsSearchBtn.setBackgroundResource(R.drawable.brand_selected);
          _itemsSearchBtn.setBackgroundResource(R.drawable.items_deselected);
          _peopleSearchBtn.setBackgroundResource(R.drawable.people_deselected);
          _allSearchBtn.setBackgroundResource(R.drawable.all_deselected);
          type="brand";
          getSearch(type,searchString);
  
          break;
      case R.id.items_search_btn:
          _brandsSearchBtn.setBackgroundResource(R.drawable.brand_deselected);
          _itemsSearchBtn.setBackgroundResource(R.drawable.items_selected);
          _peopleSearchBtn.setBackgroundResource(R.drawable.people_deselected);
          _allSearchBtn.setBackgroundResource(R.drawable.all_deselected);
          type="item";
          getSearch(type,searchString);
  
          break;
      case R.id.people_search_btn:
          _brandsSearchBtn.setBackgroundResource(R.drawable.brand_deselected);
          _itemsSearchBtn.setBackgroundResource(R.drawable.items_deselected);
          _peopleSearchBtn.setBackgroundResource(R.drawable.people_selected);
          _allSearchBtn.setBackgroundResource(R.drawable.all_deselected);
          type="user";
          getSearch(type,searchString);
  
          break;
      default:
          break;
      }       
  }
  private void getSearch(String type,String searchString) {
      if (NetworkAvailablity.checkNetworkStatus(ExploreScreenActivity.this)) {
          ArrayList&lt;NameValuePair&gt; requestParaList = new ArrayList&lt;NameValuePair&gt;();
          requestParaList.add(new BasicNameValuePair("type", type));
          requestParaList.add(new BasicNameValuePair("searchstring",searchString));
          /*requestParaList.add(new BasicNameValuePair("accesstoken",Constant.ACCESS_TOCKEN));
          requestParaList.add(new BasicNameValuePair("userid",Constant.USER_ID));
           */
          // CALL WEBSERVICE
          WebServiceCommunicator.getInstance().registerForServerResponse((IServerResponse) ExploreScreenActivity.this);
          WebServiceCommunicator.getInstance().callGetAppWebService(false,
                  this,
                  WSConstant.getUrl(WSConstant.METHOD_SEARCH),
                  ExploreScreenActivity.this, WSConstant.PID_SEARCH, false,
                  requestParaList);
      }
  }
  
  @Override
  public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {
      Intent intent=new Intent(this, FeedSelectedActivity.class);
      TabGroupActivity parentActivity = (TabGroupActivity)getParent();
      parentActivity.startChildActivity("feedselected", intent);
      //startActivity(intent);
  }
  
  private Handler _handler = new Handler() {
      public void handleMessage(Message msg) {
          switch (msg.arg2) {
          case WSConstant.PID_SEARCH:
              getJsonResponse(msg.obj.toString(), msg.arg2);
              break;
  
          default:
              break;
          }
      }
  };
  private void getJsonResponse(String response, int arg2) {
      JSONObject jObject=null;
      try {
          jObject = new JSONObject(response);
          JSONArray list = jObject.getJSONArray("posts");
  
          for (int i = 0; i &lt; list.length(); i++) {
              JSONObject element = list.getJSONObject(i);
              if ( type.equalsIgnoreCase("all")) {
                  AllBean bean= new AllBean();
                  bean.setid(element.getString("id"));
                  bean.setfullname(element.getString("fullname"));
                  bean.setusername(element.getString("username"));
                  bean.setprofile_photo(element.getString("profile_photo"));
                  bean.setprofile_type(element.getString("profile_type"));
                  bean.setprofile(element.getString("profile"));
                  _alluserlist.add(bean);
              }
              if (_alluserlist.size()!=0) {
  
                  alladapter=new GridAllUserAdapter(ExploreScreenActivity.this, _alluserlist);
                  _explorGridView.setAdapter(alladapter);
              }
  
              else if (type.equalsIgnoreCase("brand")) {
                  BrandBean bean= new BrandBean();
                  bean.setbrand_id(element.getString("brand_id"));
                  bean.setbrand_name(element.getString("brand_name"));
                  bean.setbrand_photo(element.getString("brand_photo"));
  
                  _brandlist.add(bean);
              }
              if (_brandlist.size()!=0) {
  
                  brandadapter=new GridBrandadapter(ExploreScreenActivity.this, _brandlist);
                  _explorGridView.setAdapter(brandadapter);
              }
  
              else if ( type.equalsIgnoreCase("item")) {
  
                  ItemBean bean= new ItemBean();
                  bean.setitem_id(element.getString("item_id"));
                  bean.setitem_name(element.getString("item_name"));
                  bean.setitem_photo(element.getString("item_photo"));
  
                  _itemList.add(bean);
              }
              if (_itemList.size()!=0) {
                  itemadapter=new GridItemAdapter(ExploreScreenActivity.this, _itemList);
                  _explorGridView.setAdapter(itemadapter);
              }
              else if (type.equalsIgnoreCase("user")) {
  
                  UserBean bean= new UserBean();
                  bean.setid(element.getString("id"));
                  bean.setfullname(element.getString("fullname"));
                  bean.setusername(element.getString("username"));
                  bean.setprofile_photo(element.getString("profile_photo"));
  
                  _peoplelist.add(bean);
              }
              if (_peoplelist.size()!=0) {
  
                  useradapter=new GridUserAdapter(ExploreScreenActivity.this, _peoplelist);
                  _explorGridView.setAdapter(useradapter);
              }
  
          }
      }
      catch (Exception e) {
          // TODO: handle exception
      }
  }
  
  @Override
  public void serverResponse(String response, int processid) {
      // TODO Auto-generated method stub
      Message msg = new Message();
      msg.obj = response;
      msg.arg2 = processid;
      _handler.sendMessage(msg);  
  }
  
  
  
  @Override
  public void afterTextChanged(Editable s) {
      // TODO Auto-generated method stub
      searchString=s.toString();
  
      getSearch(type,searchString);
  }
  
  
  
  @Override
  public void beforeTextChanged(CharSequence s, int start, int count,
          int after) {
      // TODO Auto-generated method stub
  
  }
  @Override
  public void onTextChanged(CharSequence s, int start, int before, int count) {
      // TODO Auto-generated method stub
  
  }
  
   }
  </code></pre>
  
  <p>i am using a searchfilter for serching items in gridview..,and i am calling webservice on serchfilter.,i am using multiple adapter for diffrent2 services.the problem is that when i search any value in that i get particular value,but when i serach another value.,my gridview doesnot clear and new value doesnot show.,what i do..,please help me.,thankyou...</p>