Valten1992
Newbie
I thought I had this fixed but c'est la vie.
My app has a splash page on startup, during this time it will connect to a server and download a file, once the download is done a 3 second timer will start then the main page of the app will load.
However, due to crappy connection in my workplace, the download can sometimes take a while, during this a black screen will show until the download is done, then the splash page and timer will start. What I want to know is why the splash page will not display over this black screen? Have I missed something?
My app has a splash page on startup, during this time it will connect to a server and download a file, once the download is done a 3 second timer will start then the main page of the app will load.
However, due to crappy connection in my workplace, the download can sometimes take a while, during this a black screen will show until the download is done, then the splash page and timer will start. What I want to know is why the splash page will not display over this black screen? Have I missed something?
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
// initialise progress icon
linProgressBar = (ProgressBar) findViewById(R.id.progressBar1);
linProgressBar.setVisibility(View.VISIBLE);
try {
this.runOnUiThread(new Runnable() {
@Override
public void run() {
initializeApp();//connect, download, disconnect
uiHandler.post(new Runnable() {
public void run() {
timer = new Timer();// timer to display loading screen
timer.schedule(new TimerTask() {
@Override
public void run() { // end page and bring up main page
startActivity(new Intent(
SplashActivity.this,
PrototypeActivity.class));
SplashActivity.this.finish();
}
}, delay);
}
});
}
});
} catch (Exception e) {
Log.e("Error", e.getMessage());
}
}