title: ImageView In Fragment not showing
body: <p>I have a strange issue that I have a workaround for but wondered if anyone could shed some light on why this is happening and a more elegant fix maybe?</p>
  
  <p>I have a ViewPager with a series of Fragments. The Fragments use their own layout and when an ImageView is added to the layout the ImageView isnt rendered at runtime. </p>
  
  <p>If I explicitly set the imageDrawable for the ImageView inside the Fragment's onCreateView method (even though the image is the same image as being referenced in the layout xml then the image shows fine.</p>
  
  <p>Here is my Fragment xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:id="@+id/baseRelLayout"
      android:background="@color/colorPrimary"&gt;
  
      &lt;ImageView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          app:srcCompat="@drawable/flamerite_remote_6"
          android:layout_marginStart="36dp"
          android:id="@+id/remote6ButtonImage"
          android:layout_alignParentBottom="false"
          android:layout_alignStart="@+id/textView3"
          android:scaleType="fitXY"
          android:background="@color/colorPrimary"
          android:layout_alignBottom="@+id/remote9ButtonImage" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And here is where I am re-setting the image drawable inside onCreateView</p>
  
  <pre><code>public class WizardFragment extends Fragment {
      public static final String STEP_NUMBER = "STEP_NUMBER";
  
      public static  final WizardFragment newInstance(String message){
          WizardFragment f = new WizardFragment();
          Bundle bdl = new Bundle(1);
          bdl.putString(STEP_NUMBER,message);
  
          f.setArguments(bdl);
          return f;
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
          View v = inflater.inflate(R.layout.wizard_fragment_step_1, container, false);
          ImageView remoteImage9Button = (ImageView)v.findViewById(R.id.remote9ButtonImage);
          remoteImage9Button.setImageDrawable(ResourcesCompat.getDrawable(getResources(),R.drawable.flamerite_remote_9, null)); //THIS IS THE LINE THAT MAKES THE IMAGE WORK AGAIN
          return v;
      }
  }
  </code></pre>
  
  <p>I can of course keep this re-set of the imageDrawable in but think it is strange that the image shoudlnt be showing when only set in the xml layout</p>
  
  <p>Any thoughts greatly appreciated!!</p>