title: Android SQLiteException no such table
body: <p>friends.</p>
  
  <p>I try to use a pre-created custom database in my android app. First I copy my DB using this code.</p>
  
  <pre><code>public void onCreate(SQLiteDatabase db) {
  
  
  
      final String DB_DESTINATION = "/data/data/com.example.android.sqlitedatabaseexample/databases/turkish2.db";
  
  
              boolean initialiseDatabase = (new File(DB_DESTINATION)).exists();
              if (initialiseDatabase == false) {
  
  
                  // Open the .db file in your assets directory
                  InputStream is = null;
                  try {
  
                      is = context.getAssets().open("turkish2.db");
  
  
                  // Copy the database into the destination
                  OutputStream os = new FileOutputStream(DB_DESTINATION);
                  byte[] buffer = new byte[1024];
                  int length;
                  while ((length = is.read(buffer)) &gt; 0){
                      os.write(buffer, 0, length);
                  }
                  os.flush();
  
                  os.close();
                  is.close();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
          }
  </code></pre>
  
  <p>then I check if database exists calling this method</p>
  
  <pre><code> public boolean checkDataBase() {
              /*Toast.makeText(getApplicationContext(),
                      "работаю", Toast.LENGTH_SHORT).show();*/
              SQLiteDatabase checkDB = null;
              try {
                  checkDB = SQLiteDatabase.openDatabase("/data/data/com.example.android.sqlitedatabaseexapple/databases/turkish2.db", null,
                          SQLiteDatabase.NO_LOCALIZED_COLLATORS/*OPEN_READONLY*/);
                  Toast.makeText(getApplicationContext(),
                          "БД на месте", Toast.LENGTH_SHORT).show();
                  checkDB.close();
              } catch (SQLiteException e) {
                  // database doesn't exist yet.
                  Toast.makeText(getApplicationContext(),
                          "БД не существует", Toast.LENGTH_SHORT).show();
              }
              return checkDB != null;
          }
  </code></pre>
  
  <p>...it shows that my database exists! Then I try to make query but get an exception.</p>
  
  <p>My database contains two tables - android_metadata and turkish. BUT.
  While I check all tables using this</p>
  
  <pre><code>Cursor c = db.rawQuery("SELECT name FROM sqlite_master WHERE type='table'", null);
  
                  if (c.moveToFirst()) {
                      while ( !c.isAfterLast() ) {
                          Toast.makeText(this, "Table Name=&gt; "+c.getString(0), Toast.LENGTH_LONG).show();
                          c.moveToNext();
                      }
                      Toast.makeText(this, "DATS ALL SUKA", Toast.LENGTH_LONG).show();
                  }
  </code></pre>
  
  <p>It showl like I have only android_metadata table. Alse when I try to make query to the table I need (turkish table) it shows SQLiteException: no such table 'turkish'</p>
  
  <p>What am I doing wrong? Help please.</p>
  
  <p>Thanks in advance!</p>