android - Null pointer Exception while transferring data -
hi trying mak application book issued person based on book id.each person can have maximum of 3 books issued on name having error on function while creating table.can me find it.
public void oncreate(sqlitedatabase db) { // todo auto-generated method stub deletedatabse(); string booktable = "create table if not exists " +book_details + " ( " + book_id + " integer primary key autoincrement, " + book_name + " text not null unique, " + type + " text, " + author + " text, " + date + " text);"; db.execsql(booktable); string persontable = "create table if not exists " +person + " ( " + person_id + " integer primary key autoincrement, " + person_name + " text not null, " + phone + " text, " + book_id + " text," + " foreign key("+trip_id +") references book_details(book_id));"; db.execsql(persontable); }
does layout file trip_history.xml include listview id zone_list? think problem there.
edit:
actually there problem in code. arrayadapter not accept null arraylist or null item in list. in case arraylist_name variable null because never send when start triphistoryactivity.
in mainactivity sending list key "lists" below.
list_bundle.putstringarraylist("lists",marraylist); so should using
arraylist_name = getintent().getstringarraylistextra("lists");
Comments
Post a Comment