Boa noite, estou tentando criar o meu 1º projeto com BD em Android.
Estou usando como base tutorial:
http://androiddevbr.wordpress.com/2013/02/19/sqlite-banco-de-dados-no-android/
Meu projeto esta neste link:
https://drive.google.com/file/d/0B8cAIXPgopaiZThISFpNYjY3NWc/edit?usp=sharing
Porem na minha classe ContaActivity.java, ao invés de colocar:
-- Estou usando como base tutorial:
http://androiddevbr.wordpress.com/2013/02/19/sqlite-banco-de-dados-no-android/
Meu projeto esta neste link:
https://drive.google.com/file/d/0B8cAIXPgopaiZThISFpNYjY3NWc/edit?usp=sharing
Porem na minha classe ContaActivity.java, ao invés de colocar:
VeiculoDAO veiculoDAO = VeiculoDAO.getInstance(getContext());
coloquei:
contaDAO ContaDAO = contaDAO.getInstance(this); // pois nao existe o metodo getContext()
quando eu abro esta tela, recebo o erro:
03-05 23:01:09.557: D/AndroidRuntime(1190): Shutting down VM
03-05 23:01:09.557: W/dalvikvm(1190): threadid=1: thread exiting with uncaught exception (group=0xb60414f0)
03-05 23:01:09.557: E/AndroidRuntime(1190): FATAL EXCEPTION: main
03-05 23:01:09.557: E/AndroidRuntime(1190): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{eti.victor.gestorfinanceiro/view.contaActivity}: java.lang.NullPointerException
03-05 23:01:09.557: E/AndroidRuntime(1190): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
03-05 23:01:09.557: E/AndroidRuntime(1190): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-05 23:01:09.557: E/AndroidRuntime(1190): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário