Delete Accentuation Autocomplete TextView

0

Good morning to the community, My problem is the following: my autocomplete matches with a listview, in which the words are written correctly. However, there are people who do not write it well (they omit accents) and do not match those words. How could I solve this? I have searched for a thousand alternatives, but none of them works for me.

How it works: I do a search on the bd. I create two string (array and array2) where the data with which I want to fill the autocomplete will be saved. When I have the complete arrangements, I create an adapter with both (adapter 1 will be for text and adapter 2 will be for days). It is filtering in the listview2 as I am writing (the listview3 is hidden and I use it for the field of days). What I want is for me to filter the words, omitting the tildes.

        String sql = ("SELECT Texto,Dias FROM Tabla2");
        Cursor c = db.rawQuery(sql, null);

        int cantidad = c.getCount();
        int i = 0;

        arreglo = new String[cantidad];
        arreglo2 = new String[cantidad];

        if (c.moveToFirst()) {
            do {

                String linea = c.getString(0);
                String linea2 = c.getString(1);
                arreglo[i] = linea;
                arreglo2[i] = linea2;
                i++;

            } while (c.moveToNext());
        }

        adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, arreglo);
        adapter2 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, arreglo2);

        autocom.setAdapter(adapter); //Este es el autocomplete
        lista2.setAdapter(adapter);
        lista3.setAdapter(adapter2);
    
asked by Alvaro Marin Perez 02.05.2018 в 14:37
source

0 answers