1. AC Question's Avatar
    ResultSet rs;
    try {
    Statement statement = conn.createStatement();
    rs = statement.executeQuery(COMANDOSQL);
    data = new ArrayList<Map<String,String>>();
    while(rs.next()){
    Map<String, String> datanum = new HashMap<String, String>();
    datanum.put("A", rs.getString("code"));
    datanum.put("B", rs.getString("description"));
    datanum.put("C", rs.getString("BALQTY"));
    data.add(datanum);
    }
    String[] from = {"A","B","C"};
    int[] views = {R.id.text_code,R.id.text_desc , R.id.text_qty};
    AD = new SimpleAdapter(this, data, R.layout.listitems, from, views);
    lv.setAdapter(AD);
    } catch (Exception e) {
    Log.e("ERRO",e.getMessage());
    }
    I tried to filter with below code but it's showing me duplicate value while I type some text.

    et.addTextChangedListener(new TextWatcher() {
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    AD.getFilter().filter(s.toString());
    }
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
    System.out.println("before changed");
    }
    public void afterTextChanged(Editable s) {
    }
    });
    01-31-2015 01:48 PM

Similar Threads

  1. Replies: 3
    Last Post: 02-01-2015, 07:31 AM
  2. Replies: 1
    Last Post: 01-31-2015, 05:25 PM
  3. Why does my phone take so long to charge since update?
    By AC Question in forum Ask a Question
    Replies: 2
    Last Post: 01-31-2015, 02:48 PM
  4. Replies: 1
    Last Post: 01-31-2015, 02:46 PM
  5. Does Intex Aqua i14 play tv out via 3.5 mm to RCA cable?
    By AC Question in forum Ask a Question
    Replies: 1
    Last Post: 01-31-2015, 02:26 PM
LINK TO POST COPIED TO CLIPBOARD