他们怎么做到的?在对话框的主屏幕对话框、屏幕

2023-09-05 10:47:36 作者:你的微笑太刺眼﹏

我正在写一个Android应用程序,我想放置一个对话框或视图在主屏幕,以便用户可以在不跳进我的全部应用程序中输入文本。我似乎无法得到这个工作。如果我present一个对话框(即使是在一个透明的活动),我的应用程序启动。

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.

感谢提前任何帮助!

-Brian

推荐答案

我的问题是,应用程序总是启动到显示该对话框。

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!

 
精彩推荐
图片推荐