Could not find class 'android.widget.ThemedSpinnerAdapter'

JoCuTo picture JoCuTo · Oct 29, 2015 · Viewed 10.1k times · Source

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

Answer

shaolin picture shaolin · Apr 1, 2016

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]