【发布时间】:2016-09-04 05:49:43
【问题描述】:
在我的 android 应用程序中,im using web-service to get information about food the problem that if i write appl instead of apple,row,skin it dosent 会自动填充并显示一条错误消息,我做了什么,我从 web 服务中存储了 2000 个名称到 sqlite 并通过它们进行搜索,这样做是错误的吗?以及如何在没有错误消息的情况下在网络服务中搜索拼写错误?
api地址http://api.nal.usda.gov/ndb/search/?format=json&q=apple&sort=n&max=25&offset=0&api_key=DEMO_KEY
【问题讨论】:
-
您使用的是什么适配器?贴出代码
-
ArrayAdapter
适配器 = new ArrayAdapter (MainActivity.this, android.R.layout.simple_dropdown_item_1line, myData); autoCom.setAdapter(适配器); -
见this
-
对不起,我没听明白,如果我像这样搜索api.nal.usda.gov/ndb/search/… 会有错误信息,那么约束是什么?
-
然后检查
runQuery里面的根元素是“list”还是“errors”
标签: android json web-services