問題描述
我正在編寫一個 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!
這篇關于他們是如何做到的呢?主屏幕上的對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!