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!
这篇关于他们是如何做到的呢?主屏幕上的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:他们是如何做到的呢?主屏幕上的对话框


基础教程推荐
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01