如何让主屏幕快捷方式启动对话框?
好的,我在这里问了另一个问题 试图让我的活动看起来像对话框。我在想,也许我不应该问具体的方法,而应该问我想做什么,也许有不同的方法来实现它......
这就是我所拥有的。我的应用程序允许将快捷方式放置在主屏幕上。创建快捷方式的代码和逻辑都完美地工作,然后快捷方式启动适当的活动,显示它应该做什么......再次,一切都完美地工作。
但我想知道的是,有没有办法让主屏幕快捷方式作为对话框启动我的活动(而不是简单地尝试使我的活动看起来像一个对话框)?
Okay, I asked another question here trying to make my activities look like dialogs. I'm thinking maybe instead of asking about a specific method, I should ask about what I'd like to do, and perhaps there is a different way to go about it...
Here's what I have. My app allows shortcuts to be placed on the home screen. The code and logic for creating the shortcuts all works flawlessly, and the shortcuts then launch the proper activity which shows what it's supposed to... again, all works flawlessly.
What I'm wondering though, is is there a way to have the home screen shortcut launch my activity as a dialog (as opposed to simply trying to make my activity LOOK like a dialog)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将其添加到您的清单中,在您希望看起来像对话框、声明的活动中:
了解更多信息和主题:
http://developer.android.com/guide/topics/ui/themes.html
此外,您可以通过编程方式使用以下代码:
您可以选择对话框的任何布局并根据需要进行设计。
此外,您需要在清单中设置以下活动声明:
希望这就是您正在寻找的内容,Gal。
Add this in your manifest, in the activity you want to look like dialog, declaration:
for more information and themes:
http://developer.android.com/guide/topics/ui/themes.html
furthermore, to this proggramatically you can use the following code:
You can choose whatever layout you wish for the dialog and design it as you want.
In addition you would need to set this activity declaration in the manifest for the following:
Hope this is what you was looking for, Gal.