vendredi 6 février 2015

How to pass an object as an argument in order to store data to a database?

I am relatively new to Android and I'm a little bit stuck as fighting my way through databases, so any guidelines are much appreciated! Here it goes~



//Random Fragment that inserts data to the databaase
mWorkoutData = new WorkoutData();
mDBTools = new DBTools(getActivity());

HashMap<String, String> queryValuesMap = new HashMap<String, String>();

queryValuesMap.put("comments", mWorkoutData.getComments());

mDBTools.insertWorkoutData(queryValuesMap);


The WorkoutData is the model class, however it does not manage to insert any data to the database while in case I pass an Edittext for example as an argument everything is fine!


Any guidelines or insights on how to solve this would be much appreciated!


Aucun commentaire:

Enregistrer un commentaire