ANDROID: How can I launch a popup dialog from an notification or long-pressed search button on top of all windows?

亡梦爱人 提交于 2019-12-04 11:58:43
Reed

I'm copying from here: Here is answer

to Start activity as dialog i defined

<activity android:theme="@android:style/Theme.Dialog">

now when i startActivity() it display like dialog and parent activity display on back, i wan a button to whom i click dialog should dismiss and parent activity should display without refreshing the page.

And then somebody added the comment:

Using the android:theme="@android:style/Theme.Dialog" is the way to go but don't forget to use excludeFromRecents=true or else your dialog will appear in the Recently Used Apps (hold the Home key).

And for the long press, override onKeyLongPress(int keyCode, KeyEvent event) and you can make the long press do what you want. http://developer.android.com/reference/android/view/View.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!