2013-10-17 30 views
2

我正在使用谷歌的地方API來獲取我的Android應用程序中的附近位置。我用這個Tutorial成功地實現了它。現在,在這裏使用'| '符號我們可以得到不止一種類型的地方。例如types = "amusement_park | bakery"將返回給定半徑內amusement_park和麪包店的地點。但在某些地區,這兩個地方可能無法同時供應。所以,我只想要兩個地方中的任何一個的結果。假設在A地區只有麪包店可用,所以我只能去附近的麪包店。但是用這個'| '符號我沒有得到任何結果。或者我可以說這個'| '表現得像AND運算符。但是我想要或者地方之間的關係。我怎樣才能做到這一點?兩種類型之間或地方之間的關係

+0

你能提供當你沒有得到你所期望的結果,你所使用的網址是什麼? – pushbit

+0

字符串類型=「amusement_park |麪包店|酒吧| book_store | cafe | clothing_store | convenience_store | department_store | electronics_store |花店|食品| gas_station | grocery_or_supermarket | hair_care | hardware_store | health | home_goods_store | liquor_store | meal_delivery | meal_takeaway | movie_rental | pet_store | restaurant | shoe_store | shopping_mall | store | university「; –

回答

2

除去空間和測試它...

String types = "amusement_park|bakery|bar|book_store|cafe|clothing_store|convenience_store|department_store|electronics_store|florist|food|gas_station|grocery_or_supermarket|hair_care|hardware_store|health|home_goods_store|liquor_store|meal_delivery|meal_takeaway|movie_rental|pet_store|restaurant|shoe_store|shopping_mall|store|university" ; 
+0

工作......謝謝你......愚蠢的錯誤...... –