how to get data from online database in recyclerview on an item selected of searchable spinner

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

I am making an online food ordering app in which first page i.e. CityActivity I getting the city and area name from online database and passing only areaname to MainActivity through Shared preference in a textbox. Now according to the area I have fetched I need to get only that area restaurants data from online database in recyclerview in android studio.

In databse ,in restro_tbl I have added restroid,restroname,cityid,areaid(foreign key as i have made city and area separate tables),restrodiscount,restrodescription,restroimg
 
I'm not an Android developer, but if the database uses SQL, it would be a select statement ending in where restroid = <whatever the id of the restaurant is - without the brackets>; You can select individual fields or * for all fields.
 
In Android, Spinner is like a dropdown list. It displays a list of items. One of its items can be selected at a time. You can use an array or an ArrayList object that contains items as its data source. Typically the array or ArrayList object is not directly set to the Spinner.