使用 CheckBoxList 从一个 Activity 获取值到另一个 Activity

发布于 2024-12-13 18:55:54 字数 162 浏览 5 评论 0原文

我想做的事情相对简单:我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ㄖ落Θ余辉 2024-12-20 18:55:54

您可以在 Cadastre 活动上使用 startActivityForResult() 启动活动,然后重写 onActivityResult() 方法来读取结果数据(在片刻)。在您的复选框活动中,在调用 finish() 之前,您必须在活动结果上设置额外内容。此页面有一个简单的示例。

You start the activity using startActivityForResult() on your Cadastre activity, and then override the onActivityResult() 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文