Spinner Error “Spinner adapter view type count must be 1”

南笙酒味 提交于 2019-11-29 14:55:34

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!

Luis Colomé

I have solved the same problem just now, and you have two possible solutions:

a. Down the targetSdkVersion to 19

b. (My prefered) Extend your parseadapter and @override the getViewTypeCount with this code:

@Override
public int getViewTypeCount() {
     return 1;
}

This works for me :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!