Hi Fadden,

  My question was not: why can't I use 2 classes loaded with different
class loaders. My question has to do with the way Android implements
the dynamical class loading thing. It won't let you load a class using
this.getClass().getClassLoader() as the "parent" parameter in the
DexClassLoader(String dexPath, String dexOutputDir, String libPath,
ClassLoader parent) constructor. Instead you have to use
MyClass.getSystemClassLoader() as the "parent" parameter. Why is that?
Why can't I load the class using the classloader which loaded all my
classes up until then?

On Apr 17, 12:31 am, fadden <fad...@android.com> wrote:
> Most of what you're describing falls into the category of, "that's how
> class loaders work in the Java programming environment".  If you
> create a class loader, and load a class called MyClass from it, you
> can't trivially refer to MyClass because the current class' loader
> can't resolve it.  You have to use reflection to get at it.  Class
> cast operations don't always do what you want.
> .............

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to