OpenWeatherMapAPI 如何使用openweathermap API从android菜单在摄氏度/华氏度之间切换

OpenWeatherMapAPI 如何使用openweathermap API从android菜单在摄氏度/华氏度之间切换,android,android-menu,openweathermap,Android,Android Menu,Openweathermap,menu.xml 如果需要,可通过Dropbox链接查看更深入的视图 来自 单位格式 说明: standard api.openweathermap.org/data/2.5/find?q=London metric api.openweathermap.org/data/2.5/find?q=London&units=metric imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial 可以使

menu.xml 如果需要,可通过Dropbox链接查看更深入的视图

来自

单位格式

说明:

standard api.openweathermap.org/data/2.5/find?q=London
metric api.openweathermap.org/data/2.5/find?q=London&units=metric
imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial
可以使用标准、公制和英制单位

参数:

standard api.openweathermap.org/data/2.5/find?q=London
metric api.openweathermap.org/data/2.5/find?q=London&units=metric
imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial
单位公制,英制。不使用“单位”参数时,默认情况下,格式为标准格式

温度以华氏、摄氏和开尔文为单位

For temperature in Fahrenheit use units=imperial
For temperature in Celsius use units=metric
Temperature in Kelvin is used by default, no need to use units parameter in API call
带有openweathermap.org/weather-data的所有API参数列表

API调用示例:

standard api.openweathermap.org/data/2.5/find?q=London
metric api.openweathermap.org/data/2.5/find?q=London&units=metric
imperial api.openweathermap.org/data/2.5/find?q=London&units=imperial

您提供的代码只与UI相关,您还需要显示业务逻辑以查看发生了什么。@sme我的问题是我只显示开尔文度,我想从菜单中更改它,但我真的没有任何线索…@sme我将上传代码,不是很多,也许那样会更容易。。。