找不到类的android.widget.ThemedSpinnerAdapter“ [英] Could not find class 'android.widget.ThemedSpinnerAdapter'
问题描述
我有,在一个片段,一个方法调用谁打开AlertDialog当一个按钮的用户水龙头,在该对话框我想以显示与国家微调(西班牙,意大利,法国....)
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, French....)
我的code的微调如下:
My code for the spinner is the following:
RestCountries restCountries = new RestCountries();
List<RestCountries.Datum> countries = restCountries.data;
String mCities ="";
ArrayList<String> citiesArrayList = new ArrayList<>();
for(RestCountries.Datum data : countries){
mCities = data.name;
citiesArrayList.add(mCities);
}
ArrayAdapter spinnerAdapter = new ArrayAdapter(getActivity(),android.R.layout.simple_spinner_dropdown_item, citiesArrayList );
mCountrySpinner.setAdapter(spinnerAdapter);
在打开对话框后,微调器显示emphy。
The spinner is showed emphy after the dialog is opened.
在logcat中我得到
On the logcat I get
找不到类的android.widget.ThemedSpinnerAdapter,引用
从方法
android.support.v7.widget.AppCompatSpinner $ DropDownAdapter。
Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.
什么我做错了任何想法
推荐答案
有此问题的几个不同的原因。
在我的情况下(试图注册解析),我得到这个错误试图在tablet.When我切换到Android手机应用程序,我得到的错误消息:
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:
您必须实例化之前注册这个子类的parseObject它
You must register this ParseObject subclass before instantiating it
所以,在我的 App.java
类我这样做:
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"
...
这是it.Had无关微调
That was it.Had nothing to do with Spinner
这篇关于找不到类的android.widget.ThemedSpinnerAdapter“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!