简体   繁体   English

我可以创建一个ListView来填充Android中的实际表名吗?

[英]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. 我对Android和SQLite数据库的使用还比较陌生,但我感谢所有反馈。

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. 我正在尝试创建一个列表视图,该列表视图将填充将与应用程序打包在一起的现有sqlite数据库中的活动中的实际表名。 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). 我在网上看到的所有示例和教程通常都是从字段级别启动listviews(已经选择了一个表并正在查询)。 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; 从DB_NAME中选择名称,其中type ='table'ORDER BY名称;

and use the results to fill an adapter. 并使用结果填充适配器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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