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

后端 未结 2 2064
说谎
说谎 2020-12-21 07:13

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.IllegalArgumentE         


        
2条回答
  •  甜味超标
    2020-12-21 07:53

    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 :)

提交回复
热议问题