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....)
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);
The spinner is showed emphy after the dialog is opened.
On the logcat I get
Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDownAdapter.<init>
Any idea about what I am doing wrong
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]