使用 TabLayout Android 时如何刷新每个 Activity?

发布于 2024-12-28 14:33:29 字数 321 浏览 3 评论 0原文

我已经问过这个问题了,但仍然没有答案。 我认为上一个问题是没有明确正确地提出问题。 是的,他们可以解决我的第一个问题,但不能解决第二个问题。

第二个问题是,当我尝试进入包含三个选项卡的 TabActivity 时,我无法在每个活动上一一刷新它。我已经创建的菜单上的刷新按钮只是刷新它,但将我带入第一个选项卡,而不是当前的活动选项卡。

有人可以帮忙吗? 提前致谢

I'd already ask about this, but still don't have an answer.
I think the previous question is not clearly delivered the question correctly.
It is right, they can resolve my first problem, but not the second one.

And the second problem is when I try to come into my TabActivity that include three tab, then I can't refresh it one by one on every activity. My refresh button on my menu that I'd already created is just refresh it but bring me into the first tab, not the current active tab.

Does anyone can help?
Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

許願樹丅啲祈禱 2025-01-04 14:33:29

这不是答案,而是对 Aditya 问题的可能澄清。

Aditya 有一个包含三个 TabActivities 的应用程序。当用户更改第一个选项卡的内容时,应该会导致其他两个选项卡的内容发生更改。当选择其他选项卡之一时,更改应该立即显示 - 也就是说,当选择其他选项卡之一时,Aditya 希望在显示内容之前更新内容。

一种(笨拙的)解决方法是在每个选项卡的布局中包含手动刷新按钮。这可行,但最好不要要求用户手动刷新视图。

此外,Aditya 的刷新按钮实现有一个错误,即它会刷新所有三个选项卡,但随后总是更改为显示第一个选项卡。 Aditya 希望刷新始终显示当前(当然是刷新的)选项卡。

理想情况下,根本不需要“刷新”按钮,因为只需选择一个新选项卡即可在显示之前更新布局。

如果我说错了,我道歉。但我就是这么读的。

This is not an answer, but a possible clarification of Aditya's question.

Aditya has an app with three TabActivities. When a user changes something in the contents of the first tab, it should cause a change in the contents of the other two tabs. The change should show up immediately when one of the other tabs is selected - that is, when one of the other tabs is selected, Aditya wants the contents to be updated before they are displayed.

One (clumsy) workaround is to include a manual Refresh button in every tab's layout. That works, but it would be better not to require the user to refresh the view manually.

In addition, Aditya's implementation of the Refresh button has a bug, in that it refreshes all three tabs, but then always changes to display the first tab. Aditya wants the refresh to always show the current (refreshed, of course) tab.

Ideally, the Refresh button would not be needed at all, since simply selecting a new tab would update the layout before displaying it.

If I have misspoken, I apologize. But that's how I read it.

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