android - Unable to display user input -


i building android todo list app uses sqldatabase saving user input(task, time, date) facing weird problem, when try update default textview user input 1 of 3 textview changes,who's id mentioned 1st 1 input read @ last leaving rest textview unchanged.

update_titleui

public void update_titleui() {     arraylist<string> tasklist = new arraylist<>();     sqlitedatabase db = mhelper.getreadabledatabase();     cursor cursor = db.query(taskcontract.taskentry.table,             new string[]{taskcontract.taskentry._id, taskcontract.taskentry.col_task_title},             null, null, null, null, null);     while (cursor.movetonext()) {         int idx = cursor.getcolumnindex(taskcontract.taskentry.col_task_title);         tasklist.add(cursor.getstring(idx));     }      if (madapter == null) {         madapter = new arrayadapter<>(this,                 r.layout.item_todo,                 r.id.task_title,                 tasklist);         mtasklistview.setadapter(madapter);     } else {         madapter.clear();         madapter.addall(tasklist);         madapter.notifydatasetchanged();     }      cursor.close();     db.close(); } 

update_timeui

public void update_timeui() {         arraylist<string> tasktime = new arraylist<>();         sqlitedatabase db = mhelper.getreadabledatabase();         cursor cursor = db.query(taskcontract.taskentry.table,                 new string[]{taskcontract.taskentry._id, taskcontract.taskentry.col_task_time},                 null, null, null, null, null);         while (cursor.movetonext()) {             int idx = cursor.getcolumnindex(taskcontract.taskentry.col_task_time);             tasktime.add(cursor.getstring(idx));         }          if (madapter == null) {             madapter = new arrayadapter<>(this,                     r.layout.item_todo,                     r.id.task_time,                     tasktime);             mtasklistview.setadapter(madapter);         } else {             madapter.clear();             madapter.addall(tasktime);             madapter.notifydatasetchanged();         }          cursor.close();         db.close();     } 

update_dateui

public void update_dateui() {     arraylist<string> tasktime = new arraylist<>();     sqlitedatabase db = mhelper.getreadabledatabase();     cursor cursor = db.query(taskcontract.taskentry.table,             new string[]{taskcontract.taskentry._id, taskcontract.taskentry.col_task_date},             null, null, null, null, null);     while (cursor.movetonext()) {         int idx = cursor.getcolumnindex(taskcontract.taskentry.col_task_date);         tasktime.add(cursor.getstring(idx));     }      if (madapter == null) {         madapter = new arrayadapter<>(this,                 r.layout.item_todo,                 r.id.task_date,                 tasktime);         mtasklistview.setadapter(madapter);     } else {         madapter.clear();         madapter.addall(tasktime);         madapter.notifydatasetchanged();     }      cursor.close();     db.close(); } 

the output comes when declare update_titleui 1st , update_dateui @ end the output comes when declare update_titleui 1st , update_dateui @ end


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -