I have a listView that show the user all item that saved in mySql database .. and for User table the user have his Country name .. my question is how I can show the user only item in his Country because I don't want to show him all the item in ListView when he open Main Activity.
Asked
Active
Viewed 89 times
0

Mayank Kumar Chaudhari
- 16,027
- 10
- 55
- 122

Wael Baaj
- 1
- 1
-
1put your try and error or any bug you are getting – Developer Nov 29 '18 at 11:23
1 Answers
1
Basically, you need to write your query with filter. You can use where clause to filter data and get only the data that belongs to the particular country. You can do something as mentioned below
SELECT * FROM Country WHERE CountryNama = 'yourCountry';
This will bring the record. And now you need to map the data in the model and add these in a list or array. And populate the date. Hope this will help you.

Abdul Waheed
- 4,540
- 6
- 35
- 58