我正在Android应用程序之间切换,我传递一系列参数以定制其他应用程序(颜色、标志等),但我找不到我传递的样式,我只能找到可绘制对象、颜色和布局。
有没有办法找到这些样式?
我正在使用以下内容:
有没有办法找到这些样式?
我正在使用以下内容:
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);
从我正在使用的其他应用程序
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?
}
其中 customization.getKeys() 是我传递的键。
resources.newTheme()
然后在返回的Resources.Theme
对象上调用applyStyle(resId, force)
吗?请参见 http://developer.android.com/reference/android/content/res/Resources.Theme.html#applyStyle(int, boolean) - ci_