I have implemented this spinner in my app. I'm displaying a dialog and I have my spinner in that dialog. I want my spinner to open as the dialog comes up. I have tried performClick() event right after setAdapter() method but it doesn't seem to work.
My code looks like this:
final MaterialBetterSpinner selectBrandForSODRating = dialog.findViewById(R.id.selectBrandForSODspinner);
final ArrayList<Products> brandList = new ArrayList<Products>();
Cursor crsCheckSODData = database.rawQuery(myQuery, null);
if(crsCheckSODData.getCount() > 0){
while (crsCheckSODData.moveToNext()) {
//data...
brandList.add(data);
}
}
crsCheckSODData.close();
final ArrayAdapter<Products> SODBrandAdapter = new ArrayAdapter<Products>(myView.this, android.R.layout.simple_dropdown_item_1line, brandList);
selectBrandForSODRating.setAdapter(SODBrandAdapter);
selectBrandForSODRating.performClick(); //this right here isnt working...