title: How to override drawables defined in an Android Library Project?
body: <p>I have two Android applications with a similar functionality but different drawables and layouts.</p>
  
  <p>I'd like to put all the code and resources in a library project and override some of the drawables and layouts in the two applications that would reference that library.</p>
  
  <p>I created an application that references the library. I copied all the resources from the library to the application and changed some of the drawables. I also changed some of the string resources. When I view one of the changed layouts in the layout editor in Eclipse, I see the correct overridden images.</p>
  
  <p>When I launch the application I see that the string resources I changed in the application are displayed correctly (the library strings are overridden by the resources of the application), but the drawables of my <code>ImageView</code>s are all taken from the resources of the library.</p>
  
  <p>I also made changes in some of the layout resources (moved and resized some images). When I launch an activity that uses the changed layout (an activity whose source code is in the library), I see the new (application) layout with the old (library) drawables. </p>
  
  <p>I tried defining the drawables of the <code>ImageView</code>s in two ways :</p>
  
  <ol>
  <li><p>in the layout xml : <code>android:src="@drawable/image_id"</code></p></li>
  <li><p>in the code of the activity : </p>
  
  <pre><code>ImageView view = (ImageView)findViewById(R.id.viewId);
  view.setImageResource(R.drawable.image_id);
  </code></pre></li>
  </ol>
  
  <p>In both cases the image I see is taken from the resources of the library project and not the application.</p>
  
  <p>If I don't manage to solve this problem, I'll have to duplicate all the code in both applications, which would be a shame.</p>
  
  <p>Am I doing something wrong?</p>