简体   繁体   中英

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.

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. for this theme require activity instead of appcompatactivity. if you want exclude from recent use in manifest android:excludeFromRecents="true"

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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