如何在家庭屏幕上展示吐司
我有一项活动使用:
val i = Intent(Intent.ACTION_MAIN)
i.addCategory(Intent.CATEGORY_HOME)
startActivity(i)
Toast.makeText(this, "Fetching attendance, hold your phone close to the terminal ...",
Toast.LENGTH_SHORT).show()
一旦调用了上述功能,就可以自动返回主屏幕,但是吐司不会显示。如何在主屏幕上表现出烤面包?
I have an activity that uses:
val i = Intent(Intent.ACTION_MAIN)
i.addCategory(Intent.CATEGORY_HOME)
startActivity(i)
Toast.makeText(this, "Fetching attendance, hold your phone close to the terminal ...",
Toast.LENGTH_SHORT).show()
To automatically return to the home screen once the function above is called, but the toast does not show up. How can I make a toast show up while on the home screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此
代表上下文。因此,而不是使用此
使用ApplicationContext
The
this
stands for the context. So instead of usingthis
useapplicationContext