@Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    mImageView = view.findViewById(R.id.image);

    final Spinner spinner = view.findViewById(R.id.spinner);
    final Entry[] entries =
        new Entry[] {
          new Entry("Vector", fromResourceId(R.drawable.xml_vector)),
          new Entry("Nine patch", fromResourceId(R.drawable.xml_nine_patch)),
          new Entry("Layer list", fromResourceId(R.drawable.xml_layer_list)),
          new Entry("Level list", fromResourceId(R.drawable.xml_level_list)),
          new Entry("State list", fromResourceId(R.drawable.xml_state_list)),
          new Entry("Bitmap", fromResourceId(R.drawable.xml_bitmap)),
        };
    spinner.setAdapter(new SimpleUriListAdapter(entries));
    spinner.setOnItemSelectedListener(
        new AdapterView.OnItemSelectedListener() {
          @Override
          public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            final Entry spinnerEntry = entries[spinner.getSelectedItemPosition()];
            setImageUri(spinnerEntry.uri);
          }

          @Override
          public void onNothingSelected(AdapterView<?> parent) {}
        });
    spinner.setSelection(0);
  }
This fragment displays different XML images.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imageformat/xml/ImageFormatXmlFragment.java