Could not find class 'android.widget.ThemedSpinnerAdapter'

前端 未结 4 1864
鱼传尺愫
鱼传尺愫 2021-01-01 20:06

I have ,in a fragment, a method call who open an AlertDialog when an user tap on an button, in that dialog I would like to show a Spinner with countries ( Spain, Italy, Fren

4条回答
  •  梦毁少年i
    2021-01-01 20:23

    I faced and win this problem!

    In case if you are using AndriodAnnotations here the problem is that I filled the lists in the method onCreate(). I used to get View via findViewById(R.id...) and worked with them.

    Now, as it turned out during debugging, all Views is not created in onCreate() yet! The problem was solved when I found an annotation @AfterViews in the docs, and the method under this annotation now fills all my actions and does initialization of fields.

    So, anyway, check your code on NullPointerException caused by invoking empty view object.

提交回复
热议问题