How to get resources from another (my) application?

PackageManager packageManager = getPackageManager(); Intent myIntent = new Intent("PACKAGE_NAME"); List<ResolveInfo> ThemePacks = packageManager.queryIntentActivities(myIntent, 0); 

PackageManager.getResourcesForActivity and PackageManager.getResourcesForApplication do not help. When accessing resources, we get "Unable to find resource ID"

PS: Resources get type and drawable

    2 answers 2

    Hmm, depending on what resources. In fact, they are compiled (those that are in res), and those that are not in the res folder, but for example in assets can be obtained by unpacking the apk-file as a zip-archive.

    I will add: I think you set the wrong task, based on this issue. I mean, there is an architectural flaw.

    • and if to go through SharedUId? Everything described by me above is described in several articles, but there is not informative and to some extent inapplicable in my situation. For example, use themes (that is, style resources) but only with color substitution, I need the theme to draw not @color, but @style and @drawable - Ururu
    • I have a question why do it at all? - DroidAlex
    • Topics for the application. Themes use styles with background images. - Ururu
    • The answer you need is the answer below - Android Library. - DroidAlex

    The recommended way to share resources is to create a shared Android Library application, or as an alternative to ContentProvider creation, which will publish its resources outside.

    • Android Library does not fit: "After the Android project is designated as a library project, it cannot be installed on the device." And besides, an inverse relationship is obtained. I need to receive data from the additional application in the main application, and if I do this, then in the main application I need to register all the libraries, and they will be compiled with it. About the content provider has not yet looked. - Ururu