spTypePets.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
spTypePets.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Resources res = getResources();
String spinner = spTypePets.getSelectedItem().toString();
switch (position) {
case 0:
Glide.with(PetsFormActivity.this).load(R.drawable.dog).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 1:
Glide.with(PetsFormActivity.this).load(R.drawable.cat).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 2:
Glide.with(PetsFormActivity.this).load(R.drawable.mouse).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 3:
Glide.with(PetsFormActivity.this).load(R.drawable.fish).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 4:
Glide.with(PetsFormActivity.this).load(R.drawable.birds).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 5:
Glide.with(PetsFormActivity.this).load(R.drawable.reptile).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
case 6:
Glide.with(PetsFormActivity.this).load(R.drawable.other).apply(RequestOptions.circleCropTransform()).into(ivPetImageForm);
break;
}
}