简体   繁体   English

如何在手机部分弹出window如图

[英]How to get pop up window in part of phone like the image

I am trying to make my own alarm app and want to have a partial view open up when an alarm activates no matter where in the phone I am at, like the image I am including.我正在尝试制作自己的闹钟应用程序,并希望在闹钟激活时打开部分视图,无论我在手机的哪个位置,就像我包含的图像一样。 Can I please get some tips on how I would do this, do I start an activity through an intent with the alarm manager?我能否获得一些关于如何执行此操作的提示,我是否通过警报管理器的意图开始一项活动? Or can I just start a fragment?或者我可以开始一个片段吗? Also, how do I get it to just be the little window, I prefer that, and do not want to launch a full screen view.另外,我如何让它成为小 window,我更喜欢它,并且不想启动全屏视图。 Apologies that I do not know much, I don't have anyone else to ask for advice.抱歉,我知道的不多,我没有其他人可以征求意见。 I am using kotlin, Thank you.我用的是kotlin,谢谢。 在此处输入图像描述

That's just a notification that has a button.那只是一个带有按钮的通知。

You'll find everything here: https://developer.android.com/training/notify-user/build-notification你会在这里找到一切: https://developer.android.com/training/notify-user/build-notification

To add a Button: https://developer.android.com/training/notify-user/build-notification#Actions添加按钮: https://developer.android.com/training/notify-user/build-notification#Actions

Just a hint: If you change the behaviour of your channel, clear your appdata or choose another id (Or even better: delete your channel via notificationManager if it's not needed anymore).提示:如果您更改频道的行为,请清除您的应用数据或选择另一个 ID(或者更好:如果不再需要,通过 notificationManager 删除您的频道)。 Otherwise the changes will not be applied.否则将不会应用更改。

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

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