简体   繁体   中英

Can I create a ListView that will populate the actual table names in Android?

I'm relatively new to Android and SQLite database use, but I appreciate any and all feedback.

I'm trying to create a listview that will populate the actual table names in an activity from an existing sqlite database that I will package with the application. The idea would be to have the user click on a table name, which in turn would launch another activity that would display select fields from that table that the user could then edit. All of the examples and tutorials I am seeing online typically are starting the listviews from the field level (already having a table selected and being queried). Is anyone aware of any examples of a top level listview populating the tables within the database?

Off the top of my head, why don't you try:

SELECT name FROM DB_NAME WHERE type='table' ORDER BY name;

and use the results to fill an adapter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM