Could not find class 'android.widget.ThemedSpinnerAdapter'

前端 未结 4 1843
鱼传尺愫
鱼传尺愫 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条回答
  • 2021-01-01 20:18

    This may not help everyone, but I was having this issue trying to add a spinner to a PopupWindow.

    I updated my compileSdkTarget from 23 to 25, and my support library version to 25.1.0, but it didn't help.

    It turned out that changing the spinnerMode to "dialog" worked round the problem:

    <Spinner
     android:id="@+id/group_spinner"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:spinnerMode="dialog"
    />
    

    It doesn't completely fix it of course if you really want a dropdown spinner.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-01 20:31

    There are several different causes of this problem. In my case (was trying to sign up to Parse), I got this error trying the app on a tablet.When I switched to an Android phone, I got the error message:

    You must register this ParseObject subclass before instantiating it

    So, In my App.java class I did this:

    public class App extends Application {
    
    
    public void onCreate() {
        super.onCreate();
        Parse.enableLocalDatastore(this);
        Parse.initialize(this, "PARSE APPLICATION ID", "PARSE CLIENT KEY");
    }
    }
    

    and then in my manifest, I did this:

    <application
        android:name=".App"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        ...
    

    That was it.Had nothing to do with Spinner

    0 讨论(0)
  • 2021-01-01 20:33

    In my case I solved the problem just setting for all the modules in the project the same SDKCompileVersion. Here it is my complete answer in a similar question

    Cheers

    Could not find class 'android.widget.ThemedSpinnerAdapter' [Android Studio]

    0 讨论(0)
提交回复
热议问题