Android 如何组合0xFF&;0x000000?

Android 如何组合0xFF&;0x000000?,android,Android,我想使用这两个值(不透明度(0xE6/#E6)和颜色(0x000000/#000000)来配置小部件的颜色 这项工作: remoteViews.setInt(R.id.widget_relative, "setBackgroundColor", 0xE6000000); 但我希望有这样的东西,我可以在一个单独的Int中存储这两个值(例如Int-Int\u不透明度和Int-Int\u颜色: remoteViews.setInt(R.id.widget_relative, "setBackgrou

我想使用这两个值(不透明度(0xE6/#E6)和颜色(0x000000/#000000)来配置小部件的颜色

这项工作:

remoteViews.setInt(R.id.widget_relative, "setBackgroundColor", 0xE6000000);
但我希望有这样的东西,我可以在一个单独的Int中存储这两个值(例如Int-Int\u不透明度和Int-Int\u颜色:

remoteViews.setInt(R.id.widget_relative, "setBackgroundColor", int_opacity + int_color);

以下是如何将其组合起来:

int int_color = 0x000000;
int int_opacity = 0xE6;

int combined_color = int_color | (int_opacity << 24)
int\u color=0x000000;
不透明度=0xE6;
int combined_color=int_color |(int_不透明度)