Cara, o que aparenta é que o contexto que você está passando pro construtor está nulo.
Onde você está chamando? Qual o contexto que você está passando?
On Mon, Jul 6, 2015 at 12:41 PM, Renato Oliveira <renato.loliveira89@gmail.com> wrote:
Segue a classe Elidio.De repente seria viável executar em um try/catch?public class DatabaseManager extends SQLiteOpenHelper {private static final String DATABASE_NAME = "crudapplication_db";private static final int DATABASE_VERSION = 1;private SQLiteDatabase database;public DatabaseManager(Context context) {super(context, DatabaseManager.DATABASE_NAME, null, DatabaseManager.DATABASE_VERSION);}@Overridepublic void onCreate(SQLiteDatabase db) {db.execSQL(Usuario.CREATE_TABLE_SCRIPT);}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {}public Cursor select(boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit) {this.openDatabase();Cursor cursor = this.database.query(distinct, table, columns, selection, selectionArgs, groupBy, having, orderBy, limit);return cursor;}public long insert(String table, String nullCollumnHack, ContentValues contentValues) {this.openDatabase();long id = this.database.insert(table, nullCollumnHack, contentValues);this.closeDatabase();return id;}public int update(String table, ContentValues values, String whereClause, String[] whereArgs) {this.openDatabase();int rowsAffected = this.database.update(table, values, whereClause, whereArgs);this.closeDatabase();return rowsAffected;}public int delete(String table, String whereClause, String[] whereArgs) {this.openDatabase();int rowsAffected = this.database.delete(table, whereClause, whereArgs);this.closeDatabase();return rowsAffected;}private void openDatabase() {if (this.database == null) {this.database = this.getWritableDatabase();}}public void closeDatabase() {if (this.database != null) {this.database.close();this.database = null;}}}--
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/d/optout.
Thiago Moura
Software Engineer
+55 (11) 9 8178 1763
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/d/optout.






0 comentários:
Postar um comentário