I wanna make every type of drivers like bike, taxi, van and bus in a separated button
Here are the blocks and the firebase list
for example when click on nearest taxi it should select only taxi items from the list
You need to add a parameter to the procedure with the text type of vehicle you desire.
If you plan on expanding the search to include multiple types of vehicles, you would need to change that parameter to a list of desired vehicle types.
Filter the entire list first, and send the filtered copy as a parameter to the procedure that finds the closes vehicle in a list.
Can you show me a block as an example please?
yes correct, i want to add all types of drivers in one list instead of creating multiple lists
https://ai2.appinventor.mit.edu/reference/concepts/pholo.html
Also search this board for the word multiselect
i seached but didn't understand how can it work by filtering
can something like that in the block below working to choose only items in the list that containing Bus only ?
This is a variation of the text CONTAINS block that is useful for this:
Use the little pulldown in the text CONTAINS block to switch flavors.
You want to apply this test to item 1 of each item, since that is the part of the item that would contain the piece(s) you want.
See
for a multiselect sample, for how to assemble the little list of vehicle types from a master list.
You could use ListView instad of List Pickers, to taste.
Nope i don't want something like that i just wanna every button choose items that containing the Bus type text from the list
for example this is the list in the firebase
[["lsamir_Taxi","31.44537","31.67908"],["iftkar_Motorcycle","31.44537","31.67908"],["emad_Taxi","31.44538","31.67916"],["mustafaalbasel_Bus","31.44537","31.67908"]]"
so when clicking on the Bus button i should select all items containg bus text
["mustafaalbasel_Bus","31.44537","31.67908"]]"
and Taxi button it should select all items containg taxi text
[["lsamir_Taxi","31.44537","31.67908"],["emad_Taxi","31.44538","31.67916"]
i hope to get what i meant so instead of creating three or firebase lists, i can add all data in one list
It's ok i will try to add each type into a separated tag