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!
这篇关于他们是如何做到的呢?主屏幕上的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:他们是如何做到的呢?主屏幕上的对话框
基础教程推荐
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
