Code example for DexClassLoader

Methods: loadClass

0
     * @param className The class name which should be instantiated. 
     * @return The loaded class. 
     * @throws ClassNotFoundException Signals that the class can not be found. 
     */ 
    public Class<?> dexLoad(String packagePath, String className) throws ClassNotFoundException {
        DexClassLoader classLoader = new DexClassLoader(
            packagePath, 
            context.getFilesDir().getAbsolutePath(),
            null,  
            getClass().getClassLoader()
        ); 
        return classLoader.loadClass(className);
    } 
         
    /** 
     * Retrieves the information about specified package. 
     * 
     * @param packageFile The file of the package to be examined. 
     * @return The information about the package. 
     *  
     * @see com.android.qrreader.installation.InstallationManager.PackageInfo PackageInfo