问题描述
我在我的应用程序中使用Parse.com当我使用ParseQueryAdapter在片段检索数据并传递到一个微调的错误,因为
java.lang.IllegalArgumentException:如果微调适配器视图类型数量必须是1
和应用程序停止。但是,如果我尝试ArrayAdapter它的工作原理。可能是什么问题?
ParseQueryAdapter code:
ParseQueryAdapter.QueryFactory<的parseObject> spnQuery =
新ParseQueryAdapter.QueryFactory<的parseObject>(){
公共ParseQuery创建(){
ParseQuery查询=新ParseQuery(tableName值);
返回查询;
}
};
ParseQueryAdapter<的parseObject>适配器=新ParseQueryAdapter<的parseObject>(getActivity()getApplicationContext(),spnQuery。);
adapter.setTextKey(COLUMNNAME);
spnLecture.setAdapter(适配器);
ParseQueryAdapter可能使用SpinnerAdapter下方。
要解决这个问题的一个方法是降低你的targetSdkVersion。此错误是被报告为21 targetSdkVersion
请在这里看到: https://开头code.google.com/p/android/issues/detail?id=79011
有一个长期的解决方案是修复适配器,这是不可能的情况下,直到解析团队决定来解决它的实施。
我曾与SpinnerAdapter同样的问题,得到了其使用targetSdkVersion 19.希望它能帮助!
工作没有外围损坏I am using Parse.com in my application when I use ParseQueryAdapter in fragment to retrieve data and pass to a spinner an error as
java.lang.IllegalArgumentException: Spinner adapter view type count must be 1
and application stops. However if I try ArrayAdapter it works. What could be the problem?
ParseQueryAdapter Code:
ParseQueryAdapter.QueryFactory<ParseObject> spnQuery=
new ParseQueryAdapter.QueryFactory<ParseObject>() {
public ParseQuery create() {
ParseQuery query = new ParseQuery(tableName);
return query;
}
};
ParseQueryAdapter<ParseObject> adapter = new ParseQueryAdapter<ParseObject>(getActivity().getApplicationContext(), spnQuery);
adapter.setTextKey(columnName);
spnLecture.setAdapter(adapter);
ParseQueryAdapter might be using SpinnerAdapter underneath.
One way to solve this issue is to lower your targetSdkVersion.This error is being reported for targetSdkVersion of 21.
Please see here : https://code.google.com/p/android/issues/detail?id=79011
A long term solution is to fix the implementation of the adapter, which is not possible for your case until Parse team decides to fix it.
I had the same issue with SpinnerAdapter and got it working without peripheral damage using targetSdkVersion 19. Hope it helps!
这篇关于微调错误&QUOT;旋转接头视图类型数量必须是1&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!