I’ve got an Android application that has a settings to turn the background images on and off.
However, I’ve had a user email me saying it creates a bad effect for his device, Galaxy Nexus running 4.0.2 (see https://www.dropbox.com/s/d61wyb325ckia9r/Screenshot_2012-04-19-00-02-27.png ) I’m unable to reproduce the issue in any emulator I have (all version from 2.2 up) or an either of my devices (2.3.7 Nexus One and Evo 4g).
It seems something with the transparency settings is throwing the rendering off.
Below is my code for toggling the background image.
void setBackground(){
if(hideBackground==true){
getWindow().setBackgroundColor(-16777216);
getWindow().setBackgroundDrawableResource(R.drawable.black);
}
else{
int pics[] = {R.drawable.bloodseeker, R.drawable.drow, R.drawable.morphling};
Random rand = new Random();
int pos = rand.nextInt(pics.length-1);
getWindow().setBackgroundDrawable(null);
getWindow().setBackgroundColor(0);
getWindow().setBackgroundDrawableResource(pics[pos]);
}
}
Anyone able to point me in the right direction for fixing this issue?
As JRaymond commented on my original post, setting the background of the root view worked to fix this issue.