我正在编写一个 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!
这篇关于他们是如何做到的呢?主屏幕上的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!