Skip to content Skip to sidebar Skip to footer

Load Data Spinner From Sqlite And Mysql

I try this tutorial to load Spinner from sqlite and mysql. Tthe tutorial works, but this app can't load from mysql twice. So this app is load mysql when first debugging only or whe

Solution 1:

Currently you are not opening database for deletion :

Change your SpinnerUpdate method as in MySQLite Activity:

privatevoidSpinnerUpdate(){
// database handler
dh = new DatabaseHandler(getApplicationContext());
dh.loadAll();
}

and Change your loadAll method as in DatabaseHandler:

publicvoidloadAll() {

//context.deleteDatabase(DATABASE_NAME);
SQLiteDatabase db = this.getWritableDatabase(); 
db.delete(DatabaseHandler.TABLE_LABELS, null, null);
} 

Post a Comment for "Load Data Spinner From Sqlite And Mysql"