Made listview in main use an arraylist rather than directly from database, as well as other fixes