How to show splash screen while initializing database?
<p>I have created an splash screen, which works perfectly. Now I want to load database while showing splash screen and after database has been loaded completely show the application UI. <br/> I have the following code to do this is this right? <br/></p>

<pre><code>public class Splash extends Activity{

@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);
    new LoadDatabase().execute();
}

@Override
protected void onPause() {
    super.onPause();
    finish();
}

// Load DB
protected class LoadDatabase extends AsyncTask&lt;Context, Integer, String&gt; 
{ 
     @Override 
     protected String doInBackground( Context... params ) { 
         try {
            new DatabaseHelper(getApplicationContext()).initializeDatabase();
        } catch (IOException e) {
            e.printStackTrace();
        }
         return "";
     } 

     @Override 
     protected void onPreExecute() { 
        super.onPreExecute(); 
        setContentView(R.layout.splash);
     } 

     @Override
    protected void onPostExecute(String result) {           
        super.onPostExecute(result);
         Intent openMain = new Intent("com.nepways.MAIN"); 
         startActivity(openMain); 
    }
}
</code></pre>

<p>}</p>

<p><br/> Is there any good example or suggestions?? please help me out with this.</p>
