Thread runs after statements below are executed
<p>I am showing a countdown while Realm  <strong>dataBase</strong> is loaded from the <strong>asset</strong> file</p>

<pre><code> SharedPreferences wmbPreference = PreferenceManager.getDefaultSharedPreferences(this);
            boolean isFirstRun = wmbPreference.getBoolean("FIRSTRUN", true);
            if (isFirstRun)
            {
                handler = new Handler();
                Runnable r = new Runnable() {
                    public void run() {
                        Intent intent=new Intent(context,FirstRun.class);
                        startActivity(intent);
                    }
                };
                handler.post(r);


                RealmConfiguration config = new RealmConfiguration.Builder(context)
                        .name(Realm.DEFAULT_REALM_NAME)
                        .migration(new in.webic.longevity.longevity.Word())
                        .assetFile(context, "Default.realm")
                        .schemaVersion(0)
                        .build();

                realm = realm.getInstance(config);
                realm.close();

                SharedPreferences.Editor editor = wmbPreference.edit();
                editor.putBoolean("FIRSTRUN", false);
                editor.commit();

            }
</code></pre>

<p><strong>Problem:</strong><br></p>

<blockquote>
  <p>countdown should be show, rather a blank screen while asset file is
  copying as default database</p>
</blockquote>

<p>Yet activity starts after few seconds(which is in the thread) taken by the code below to load the asset file,<br>Is there a better way to show countdown while Realm configuration is setup.<br>
any help would be appreciated<br>Thanks</p>