It is necessary to somehow set the search base Mysql. In the database, names, contacts, etc., and all this output in the list view .

Maybe someone has something good? Need to search through Edit Text , Seach view Bar not an option. I will be grateful

    1 answer 1

    A very general question. Then here is the general answer: addTextChangedListener your listener on your EditText via addTextChangedListener . In the afterTextChanged method afterTextChanged listener implements the search you need by the current EditText value. Search logic at your discretion. This can be either a direct database request or a complex caching system.

    Further simple example, but in this form can not be used. It is necessary to screen characters so that the malicious hacker will not destroy your database.

     //Connection con = получение конекшена к базе данных. Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM YOUR_TABLE WHERE your_field = '" + yourEditText.getText() + "'"); if (rs.next()) { // действия с результатом запроса. } rs.close(); 
    • I found an alternative solution. I don’t need to create a search engine and put a suit on it)))) something came up with something but in general it works gud! - elik