title: Using same sqlite for three activities
body: <p>I am using three activities which are opened at the same time. All activities are retreive data from sqlite. I don't close or re open my connection when i am going from activity a->b or from b->c.
  I just dispose my db when activity is destroying.</p>
  
  <p>Activity A</p>
  
  <pre><code>SqliteConnection db;
  
  OnCreate method
  db = new SqliteConnection(mypath);
  
  OnDestroy
  db.Dispose();
  db=null;
  
  Onbuttonclick
  startActivity(new Intent(this, ActivityB));
  </code></pre>
  
  <p>Same code is running when i am going from activity b->c.
  Inside the same activity i use sqlite plenty of times.</p>
  
  <p>Is this a good practice? Should i dispose my connection immediatelly after a use? Or should i close my connection on pause and reopen on resume?  Or can i pass the same opened connection to the next activity? Which is the best approach?</p>
  
  <p>Question modifieded</p>
  
  <pre><code>class databaseHelper
  {
        private static SqliteConnection db;
  
        public static SqliteConnection openDatabase(Context context)
     {
           if(db==null)
               db = new SqliteConnection(mypath);
  
             return db;
  
     }
  
  }
  </code></pre>
  
  <p>And inside my activity on create</p>
  
  <pre><code>  databaseHelper.openDatabase(this).myquery....
  </code></pre>