title: List available Android resource packages at runtime?
body: <p><a href="http://developer.android.com/reference/android/content/res/Resources.html#getIdentifier%28java.lang.String,%20java.lang.String,%20java.lang.String%29" rel="nofollow">Resources.getIdentifier(String,String,String)</a> requires the resource package. Unfortunately, if the APK was built with <code>aapt</code>'s <code>--rename-manifest-package</code> option, the resource package won't be the same as the package returned from <a href="http://developer.android.com/reference/android/content/Context.html#getPackageName%28%29" rel="nofollow">Context.getPackageName()</a>. For instance, if <code>AndroidManifest.xml</code> has the following:</p>
  
  <pre><code>&lt;manifest package="foo.bar" ...&gt;
  ...
  &lt;/manifest&gt;
  </code></pre>
  
  <p>but <code>aapt</code> is run with <code>--rename-manifest-package foo.bar.baz</code>, then the APK's resources will have the package name <code>foo.bar</code> while <code>Context.getPackageName()</code> will return <code>foo.bar.baz</code>. Thus, calls to <code>Resources.getIdentifier(String,String,String)</code> will return <code>0</code> whenever the package name from <code>Context.getPackageName()</code> is used.</p>
  
  <p>How can I get a list of the available resource packages in the APK so I can search them for my resource identifier?</p>