Hi guys im trying to put a button on each row of a list but i get null pointer exception, i'll show the java files below. The list view is in a seperate xml file to the button because button is inside a relative layout. Can anyone help?.

This class gets data from a database and puts it in array and displays in a list view which works fine until i try to put a button in each row.

I managed to fix my problem it was stupid , i was selecting the wrong layout . Have a small problem now though, previously my list view was populated with data from the db now the data isnt there and its just an empty row with a button. Im guessing its something to do with the custom adapter , for example im not giving it my database data maybe im not sure.