Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Exception ao fazer Insert no BD

Pessoal, segui o passo a passo, conferi todas as queries, porém no momento de incluir o primeiro Aluno, o app está lançando uma exceção e retorna para a tela ListaAlunosActivity ainda vazia, poderiam me ajudar?

Segue a mensagem de erro:

09-16 17:23:03.356 2584-2584/br.com.alura.agenda E/SQLiteDatabase: Error inserting nome=teste1 nota=9.0 endereco=1234 site=www telefone=1234
                                                                   android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: Alunos.EXT (code 1299)
                                                                       at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
                                                                       at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:780)
                                                                       at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
                                                                       at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
                                                                       at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1471)
                                                                       at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1341)
                                                                       at br.com.alura.agenda.dao.AlunoDAO.insere(AlunoDAO.java:46)
                                                                       at br.com.alura.agenda.FormularioActivity$override.onOptionsItemSelected(FormularioActivity.java:42)
                                                                       at br.com.alura.agenda.FormularioActivity$override.access$dispatch(FormularioActivity.java)
                                                                       at br.com.alura.agenda.FormularioActivity.onOptionsItemSelected(FormularioActivity.java:0)
                                                                       at android.app.Activity.onMenuItemSelected(Activity.java:2908)
                                                                       at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:406)
                                                                       at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195)
                                                                       at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:103)
                                                                       at android.support.v7.app.AppCompatDelegateImplV9.onMenuItemSelected(AppCompatDelegateImplV9.java:667)
                                                                       at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:810)
                                                                       at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
                                                                       at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:957)
                                                                       at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:947)
                                                                       at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:616)
                                                                       at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:153)
                                                                       at android.view.View.performClick(View.java:5198)
                                                                       at android.view.View$PerformClick.run(View.java:21147)
                                                                       at android.os.Handler.handleCallback(Handler.java:739)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-16 17:23:03.474 2584-2931/br.com.alura.agenda E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa30a4560
09-16 17:23:03.479 2584-2931/br.com.alura.agenda D/OpenGLRenderer: endAllStagingAnimators on 0xa1ac8000 (RippleDrawable) with handle 0xa1f7fff0
09-16 17:23:05.361 2584-2931/br.com.alura.agenda E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa30a1540
1 resposta
solução!

Eu fiz um teste, mudando a versão no construtor, acho que isso de alguma forma forçou um DROP TABLE e funcionou.