Android:在新线程上获取用户输入(软键)

发布于 2024-10-05 13:20:08 字数 177 浏览 0 评论 0原文

当主用户界面位于新线程上时,我似乎无法让软键输入起作用。我想做的是,当他们按下“后退”软键时,它会烤面包或其他东西。

源代码: http://pastebin.com/8gh41j9c

谢谢!

I cant seem to get the soft keys input to work while the main UI is on a new thread. I want to make it so when they hit the Back soft key it will toast or something.

Source Code:
http://pastebin.com/8gh41j9c

Thanks!

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

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

发布评论

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

评论(1

千笙结 2024-10-12 13:20:08

当主 UI 位于新线程上时

“主 UI”永远不会位于“新线程”上。 “主用户界面”不在您链接到的代码中的“新线程”上。

我想要做到这一点,以便当他们按下“后退”软键时,它会烤面包或其他东西。

覆盖 Android 2.x 设备的 onBackPressed()

while the main UI is on a new thread

The "main UI" is never on "a new thread". The "main UI" is not on "a new thread" in the code you linked to.

I want to make it so when they hit the Back soft key it will toast or something.

Override onBackPressed() for Android 2.x devices.

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