when I launch my application, there is a black screen that appears for few moments and then only splash screen appears.I followed some of the solutions from this thread but none worked.What might be the actual cause of it? can anyone help? I have pasted the code below.
SplashScreenActivity.java
public class SplashScreenActivity extends Activity {
private static final int SPLASH_TIME_OUT = 3 * 1000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_splash);
Util.doGuestLoginAndCheckForExpireDate();
UserDetail.deleteUserDetailJson();
Util.setProfileFetchStatus(false);
// Start animating the image
final ImageView splash = (ImageView) findViewById(R.id.logoImageViw);
final TranslateAnimation anim = new TranslateAnimation(0f, 0f, 1200f, 0f);
anim.setDuration(1200);
anim.setFillAfter(true);
splash.startAnimation(anim);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
splash.setAnimation(anim);
if (Util.getLoginStatus()) {
startActivity(new Intent(SplashScreenActivity.this, RestActivity.class));
} else
startActivity(new Intent(SplashScreenActivity.this, AppIntroduction.class));
finish();
}
}, SPLASH_TIME_OUT);
}
}
This is thetheme
I've included in Application tag
inside Android manifest.xml
file
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/primary_color</item>
<item name="windowNoTitle">true</item>
<item name="colorAccent">@color/primary_color</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
<item name="android:windowContentOverlay">@null</item>
</style>
Anything Am I doing wrong here??