I need to know how to load a class which doesn't have a package, using a different classloader (test.jar contains the classes.dex file):
File f = new File("/sdcard/test.jar");
final File optimizedDexOutputPath = context.getDir("outdex", 0);
DexClassLoader classLoader = new DexClassLoader(f.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, context.getClassLoader());
If "Test" class has a package:
package com.test;
public class Test {
public static void test() {
// do something
}
}
This works:
Class<?> myClass = classLoader.loadClass("com.test.Test");
If "Test" class doesn't have a package:
public class Test {
public static void test() {
// do something
}
}
This doesn't work:
Class<?> myClass = classLoader.loadClass("Test");
Is it possible to load a class without a package?