search function in android for getting data in mysql

后端 未结 1 672
时光说笑
时光说笑 2021-01-28 03:39

i want to add a search Function.I have seen the tutorial. I try to add the code but still have error.Maybe,I don\'t understand Adapter. public class orderActivity extends Lis

1条回答
  •  走了就别回头了
    2021-01-28 04:24

    Please download the project on its entirety and run it. Once it works, try breaking it apart to learn the bits and pieces. And, this is in no way using the search feature for getting data from mysql.

    If you wish to implement search using mysql, you need to have your table with its data. Have a filtering method on your cursor adapter. Then on the onTextChanged() listener, you have to query your database according to what user inputted.

    eg. select * from table where name like "s%"; // if the user has inputted s. 
    

    0 讨论(0)
提交回复
热议问题