title: Replace the Android system classloader
body: <p>I'm doing some research about Android architecture and I'm facing some issues. I have build in a some way a modular arch for Android (plugin like) but there is a huge error :</p>
  
  <pre><code>ClassCastException: android.support.v7.widget.RecyclerView cannot be cast to android.support.v7.widget.RecyclerView
  </code></pre>
  
  <p>Ok, it's easy to understand. I created a custom class loader which loads the plugins but the view is inflated in another thread or with a custom classloader. That's why the two classes cannot be compared, but do you know if it even possible to change the custom classloader or specify a classloader to the inflater ? Can I """hack""" the dalvik to perform custom class loading ?</p>
  
  <p>I tried this solutions : <a href="https://stackoverflow.com/questions/5380275/replacement-system-classloader-for-classes-in-jars-containing-jars">Replacement System Classloader for Classes In Jars containing Jars</a> but doesn't work. I also read <a href="http://shadowwhowalks.blogspot.fr/2013/02/android-replacing-system-classes.html" rel="nofollow noreferrer">http://shadowwhowalks.blogspot.fr/2013/02/android-replacing-system-classes.html</a> very interesting but the sources and some infos are missing.</p>
  
  <p>Thanks.</p>