I have successfully implemented an SQLite database in my Android app insofar as I can add information using EditTexts, Spinners and RatingsBars and view that information in a ListView. The next step I am trying to implement is to turn the ListView into a list of buttons rather than just text. Essentially, I would like to be able to click on an element in the list and then be taken to a screen that lists that element’s attributes – at the bottom, I would like to put two buttons: “Edit Entry” and “Delete Entry”. How do I go about using the information from my SQLite database to dynamically populate the texts visible on buttons?
I have successfully implemented an SQLite database in my Android app insofar as I
Share
I don’t think you will need to use buttons. You can implement the OnItemClickListener interface from your Activity and detect when an item in the list was pressed and perform your actions there.
For populating the ListView from the database you will need to extend Android CursorAdapter.
If you really want to use buttons in your ListView you will need to extend BaseAdapter and in the adapter
place a button in the List Item. But I still think that using just the ListView and OnItemClickListener will solve your problem.