3

I'm swappping between applications in Android, I pass a series of parameters to customize the other application (colors, logos, etc.), but I can't find the styles I pass, I can only find the drawables, colors, layouts.

Is there a way to find the styles?

I'm using this

Intent intent = new Intent();
        intent.setClassName("com.app.to.call", "com.app.to.call.LoginActivity");
intent.putExtra("package", getPackageName());
intent.putExtra("style", R.style.AppTheme);
startActivity(intent);

From the othe app I'm using

if(customization.getKeys().getString(Global.LINK_PACKAGE) == null) {
            customization = null;
        }else{
            Resources resources = getPackageManager().getResourcesForApplication(customization.getKeys().getString(Global.LINK_PACKAGE));
            container.setBackgroundColor(resources.getColor(customization.getKeys().getInt(Global.LINK_BACKGROUND_COLOR)));
            setTheme();//How can I get the style?
        }

where customization.getKeys() are the keys I pass.

Rudy_TM
  • 1,420
  • 4
  • 15
  • 27

1 Answers1

0

Remember that R class between two application can have the same name variable but a different value. I don't recommend pass R values between apps

  • Don't recommend? It's a big no no. – ci_ Apr 21 '15 at 20:00
  • lol I know XD, tha's why i'm passing the variable and the package name to the other app so I can get the resources putting the package. @ci_ – Rudy_TM Apr 21 '15 at 22:19
  • @Rudy_TM Oh I see now. Have you tried `resources.newTheme()` and then calling `applyStyle(resId, force)` on the returned `Resources.Theme` object? See http://developer.android.com/reference/android/content/res/Resources.Theme.html#applyStyle(int, boolean) – ci_ Apr 22 '15 at 09:55
  • I have tried it, but the resId i pass from the other app always says "is not found" I have no problem with the drawables or other stuff only this little devil. @ci_ – Rudy_TM Apr 22 '15 at 18:13
  • @Rudy_TM Can you add exactly what you tried into the question? – ci_ Apr 22 '15 at 18:48