I’ve seem to run into some kind of weird issue with tiling backgrounds getting stretched under certain conditions.
My application has a welcome screen (with sign in / sign out) as it’s main activity. If the the user is already signed in, s/he gets automatically redirected to another activity from the onCreate method.
The problem is that the tiling background of the application window gets stretched whenever this happens.
Now, the tiling works perfectly for all backgrounds as long as I’ve “seen” the main activity. That is, if I remove the call to startIntent from onCreate – or – if i go “back” to the welcome screen and continue from there.
I’ve tried “jumping” from onResume as well, but the issue remains.
Setting the background via themes.xml
<item name="android:windowBackground">@drawable/application_background</item>
drawable/application_background.xml (which also includes a subtle gradient)
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@drawable/noise" android:tileMode="repeat" />
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="90"
android:startColor="#3000"
android:endColor="#0000" />
</shape>
</item>
</layer-list>
The relevant code from WelcomeActivity.java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.welcome);
// ... init buttons etc
// Jump directly to the reading list user already has valid credentials
if(hasValidCredentials()) {
startActivity(new Intent(this, ActivityReadingList.class));
}
}
A crude Gimp illustration of the issue:

Any help would be appreciated.
Thanks,
/C
I also ran into this problem and its so annoying as there’s NO help available on the net to fix this. So, i assume its a bug in the SDK.
Anyhow, to overcome this issue, here’s my hack:
make another copy of your application_background.xml for example:
original: application_background.xml
copy: copy_application_background.xml
now associate one of your activity with original background and the second with the copy
for activity one:
for activity two:
hope it should work for you as it certainly did for me.
I guess the problem is something with the caching on background as both activities are using the same source and it causes to mess up with the tiling when an activity make calls to another one before being shown itself