简体   繁体   English

如何制作弹出式活动?

[英]How to make a popup activity?

I want to make an activity that when called appears as a small popup on top of any current app (or home screen) kinda like google assistant usually does when called.我想做一个活动,当被调用时显示为任何当前应用程序(或主屏幕)顶部的一个小弹出窗口,有点像谷歌助手通常在调用时所做的那样。 It is intended to ask for a fingerprint input for 3 seconds or hide if user touches outside its window.它旨在要求指纹输入 3 秒或在用户触摸其窗口外时隐藏。

Google assistant is service not any popup activity.谷歌助手是服务而不是任何弹出活动。 you can do popup activity but, it will only work for when app in foreground like google assistant need background service.您可以进行弹出式活动,但是,它仅适用于像谷歌助手这样的前台应用需要后台服务时。 you can use theme android:theme="@android:style/Theme.Holo.Light.Dialog.MinWidth" for activity make like pop dialog.您可以使用主题android:theme="@android:style/Theme.Holo.Light.Dialog.MinWidth"进行弹出对话框等活动制作。 for this theme require activity instead of appcompatactivity.对于这个主题需要活动而不是 appcompatactivity。 if you want exclude from recent use in manifest android:excludeFromRecents="true"如果你想从清单中的最近使用中排除android:excludeFromRecents="true"

 <activity
        android:name=".ActivityName"
        android:excludeFromRecents="true"
        android:label="@string/app_name" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM