I am trying to find classes inside a package in Android. 

PathClassLoader.getResources(packageName) does return an Enumeration, but 
its empty. What am I doing wrong?

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

String path = packagePath.replace('.', '/');

 Enumeration<URL> packageURLs = classLoader.getResources(path);

 while (packageURLs.hasMoreElements()) {

 URL packageURL = packageURLs.nextElement();

 File folder = new File(packageURL.getFile());

 File[] contenuti = folder.listFiles();

 String entryName;

 for (File actual : contenuti) {

  entryName = actual.getName();

  entryName = entryName.substring(0, entryName.lastIndexOf('.'));

  plugins.add(entryName);

 }

 }

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to