Commit 8c4294f9 by german

Arreglado bug por el cual no aparecian todos los supervisores asociados a un…

Arreglado bug por el cual no aparecian todos los supervisores asociados a un niño en el tablet (Solucion añadir el id de stu tambien a la busqueda para ver si esta en local)
parent 4b8c29d7
......@@ -212,10 +212,8 @@ public class Device extends SQLiteOpenHelper {
SQLiteDatabase db = this.getReadableDatabase();
Hashtable<String, String> users = new Hashtable<>(3);
Cursor cursor = db.rawQuery(" SELECT email_sup, name_sup, surname_sup,id_sup FROM users_detail WHERE id_stu = "+id_stu ,null);
while (cursor.moveToNext()) {
while (cursor.moveToNext())
users.put(cursor.getString(0), cursor.getString(1) + ", " + cursor.getString(2) + ";" + cursor.getInt(3));
Log.i(LOG_TAG,"Supervisor recuperado: "+cursor.getString(1));
}
cursor.close();
//db.close(); <--no es necesario cerrar la bbdd https://groups.google.com/forum/#!msg/android-developers/NwDRpHUXt0U/jIam4Q8-cqQJ
return users;
......
......@@ -250,7 +250,6 @@ public class StudentFragmentGrid extends Fragment{
, currentUser.get_gender_stu(), currentUser.get_lang_stu(), currentUser.get_json_attrs(),
(int) supervisor.get("id"), supervisor.get("email").toString(), "_", supervisor.get("name").toString(), supervisor.get("surname").toString(), supervisor.get("pic").toString(),
supervisor.get("gender").toString(), supervisor.get("lang").toString(), supervisor.get("ttsEngine").toString(), supervisor.get("office").toString()));
Log.i(LOG_TAG,"Supervisor: "+supervisor.getString("name")+" insertado");
}
} catch (JSONException e) {
e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment