title: Android SQLite delay
body: <p>I have this code that is an example I found. In this code, I insert 2 rows and then read them. What I want to do is read the first row and wait 5 seconds then read the second row and wait for 5 seconds. How that can be done?</p>
  <p>this is the code:</p>
  <pre><code>package net.learn2develop.Database;
   
  import android.app.Activity;
  import android.database.Cursor;
  import android.os.Bundle;
  import android.widget.Toast;
   
  public class DatabaseActivity extends Activity {
      /** Called when the activity is first created. */
     
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
   
          DBAdapter db = new DBAdapter(this);
   
          //---add 2 titles---
          db.open();        
          long id;
          id = db.insertTitle(
                  &quot;0470285818&quot;,
                  &quot;java ++ :)&quot;,
                  &quot;someone&quot;);        
          id = db.insertTitle(
                  &quot;047017661X&quot;,
                  &quot;Professional Programming&quot;,
                  &quot;someone2&quot;);
          db.close();
          
          //---get all titles---
          db.open();
          Cursor c = db.getAllTitles();
          if (c.moveToFirst())
          {
              do {          
                  DisplayTitle(c);
              } while (c.moveToNext());
          }
          db.close();
          
      } 
      
      public void DisplayTitle(Cursor c)
      {
          Toast.makeText(this, 
                  &quot;id: &quot; + c.getString(0) + &quot;\n&quot; +
                  &quot;ISBN: &quot; + c.getString(1) + &quot;\n&quot; +
                  &quot;TITLE: &quot; + c.getString(2) + &quot;\n&quot; +
                  &quot;PUBLISHER:  &quot; + c.getString(3),
                  Toast.LENGTH_LONG).show();        
      } 
  
  }
  </code></pre>