使用 CheckBoxList 从一个 Activity 获取值到另一个 Activity
我想做的事情相对简单:我的 SQLite 数据库中有 3 个表:Filmes(电影)、Genero(流派)和 Filmes_Genero(在表之间建立关系的表)。因此,我有一个带有电影地籍表的屏幕和另一个屏幕,其中列出了通过地籍屏幕上的按钮调用的电影的可能类型。那么如何才能将复选框的值返回到我的地籍活动中呢?
What I want to do is relatively simple: I have 3 tables on my SQLite database: Filmes (Movies), Genero (Genre) and Filmes_Genero (a table that make a relationship between the tables). So I have a screen with a movie cadastre form and another screen that lists the possible genres for the movie that is called by a button from Cadastre screen. So how can I get the values of checked boxes back to my Cadastre Activity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在
Cadastre
活动上使用startActivityForResult()
启动活动,然后重写onActivityResult()
方法来读取结果数据(在片刻)。在您的复选框活动中,在调用 finish() 之前,您必须在活动结果上设置额外内容。此页面有一个简单的示例。You start the activity using
startActivityForResult()
on yourCadastre
activity, and then override theonActivityResult()
method to read the result data (in a moment). In your checkbox activity, before you call finish(), you must set the extras on the activity result. This page has a simple example.