How do they do it? Dialogs over home screen(他们是如何做到的呢?主屏幕上的对话框)
问题描述
我正在编写一个 Android 应用程序,我想在主屏幕上放置一个对话框或视图,以便用户无需跳转到我的完整应用程序即可输入文本.我似乎无法让它工作.如果我呈现一个对话框(即使是在一个透明的活动中),我的应用程序也会启动.
I'm writing an Android application and I would like to place a dialog or view over the home screen so that a user can enter text without jumping into my full application. I can't seem to get this to work. If I present a dialog (even in a transparent activity), my application launches.
如果您不知道我在说什么,请查看 Facebook 小部件.我想复制与单击你在想什么?"类似的行为.盒子.
If you don't know what I'm talking about, take a look at the Facebook widget. I want to replicate a similar behavior to the clicking on the "What's on your mind?" box.
提前感谢您的帮助!
-布赖恩
推荐答案
我的问题是应用程序总是启动以显示对话框.
My problem was that the application always launched to display the dialog.
为了解决这个问题,我在清单中将活动启动模式设置为 singleInstance
.现在它会在主屏幕上显示对话框!
To solve this, I set the activity lauch mode to singleInstance
in the manifest. Now it shows the dialog over the home screen!
这篇关于他们是如何做到的呢?主屏幕上的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:他们是如何做到的呢?主屏幕上的对话框


- Android viewpager检测滑动超出范围 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01