java - How to display data fetched from the database table into listview? -
my function in sqladapter class
is
public arraylist<airline> getairlinedetails(string bookingdate) { cursor curcalllog =db.rawquery("select * "+ book + " " + date + " between '" + startdate + "' , '" + enddate + "'", null); if (curcalllog != null) { if (curcalllog.movetofirst()) { { a=new airline(); //a.setbookingdate(curcalllog.getstring(1)); a.setpickupadd(curcalllog.getstring(2)); a.setcity(curcalllog.getstring(3)); a.settrip(curcalllog.getstring(4)); a.setfdate(curcalllog.getstring(5)); a.setftime(curcalllog.getstring(6)); a.setcdate(curcalllog.getstring(7)); a.setptime(curcalllog.getstring(8)); a.setseats(curcalllog.getint(9)); a.setamount(curcalllog.getint(10)); update.add(a); } while (curcalllog.movetonext()); } } return update; }
m fetching data between 2 dates , want show fetched data listview please me how m new in android development.
you can use simplecursoradapter showing databse contents in listview. make instance of simplecursoradapter , pass cursor object it. refer link
if want customized listview, can customize simplecursoradapter extending custom adapter class.
Comments
Post a Comment