Code example for SQLiteDatabase

Methods: isOpen, isDbLockedByOtherThreads

0
    return getDatabase(); 
  } 
 
  private synchronized SQLiteDatabase getDatabase()
  { 
    if(db == null || !db.isOpen())
    { 
      db = super.getWritableDatabase();
      lockedAt = new Throwable();
    } 
 
    if(db.isDbLockedByOtherThreads())
    { 
      Log.v("DATABASE!", "Database is locked: ", new Throwable());
      Log.v("DATABASE!", "Locked at: ", lockedAt);
    } 
 
    return db;
  } 
 
  public synchronized <T> T executeWritableTask(WritableDatabaseTask<T> task)