bg_repeat.xml:
<?xml version="1.0" encoding="UTF-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg_pattern"
android:tileMode="repeat" />
bg_pattern.jpg:

if i launch app in portrait mode:

and output is okey.
and if launch app in landscape mode,sometimes output(in splashScreen BG and Main BG) is like:

and second problem in this mode(LandS): i change orientation to portrait,and press back button to close app,its refresh current activity(1,2,or even 4 time via each pressing Back btn)(refresh means go back to current activity from current! )
whats wrong? is this a bug?(each two question).
bytheway its my splashScreen.java code:
public class SplashScreen extends Activity {
private int _splashTime = 2000;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscreen);
new Handler().postDelayed(new Thread(){
@Override
public void run(){
Intent mainMenu = new Intent(SplashScreen.this, NextAct.class);
SplashScreen.this.startActivity(mainMenu);
SplashScreen.this.finish();
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
}
}, _splashTime);
}
}
after all i said,i use customTheme.
this is manifest xml code:
<activity android:theme="@style/CustomTheme"
android:label="@string/app_name"
android:name=".SplashScreen">
and this is part of styles.xml code:
<style name="CustomTheme" parent="@android:style/Theme.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/bg_repeat</item>
</style>
but don’t test this new app,that has problem or not.
Not repeating background is a known bug which was partially fixed in ICS and fully in JB. There’s a workaround, you have to wrap bitmap in layout and then set repeating in code in onCreate like this :