title: try/catch not working and crashes app android
body: <p>I am inserting some data in my SQLite database android. I created an ArrayList of Content values. Below is <strong>my code</strong>.</p>
  <pre><code>try {
                  SQLiteDatabase db = this.getWritableDatabase();
                  db.beginTransaction();
                  for (int i = 0; i &lt; arrayListAudio.size(); i++) {
                      db.insert(TABLE_AUDIO_FILES, null, arrayListAudio.get(i));
                  }
                  for (int i = 0; i &lt; arrayListText.size(); i++) {
                      db.insert(TABLE_TEXT_FILES, null, arrayListText.get(i));
                  }
                  db.setTransactionSuccessful();
                  db.endTransaction();
                  db.close();
                  //arrayListText.clear();
                  //arrayListAudio.clear();
  } catch (SQLException e) {
         Log.d(&quot;vijaysee&quot;, e.getMessage());
  }
  </code></pre>
  <p>It works but sometimes it does not work and crashes the application</p>
  <p>My problem is that it crashes the application directly because try/catch not working. If there is any problem in the code then it should call catch but instead, it crashes the application. I think that there should be some change in catch brackets like <code>catch(// some change){} </code>. Please help me with this.</p>