简体   繁体   English

如何在主屏幕上创建快捷方式以计数时间

[英]How to create shortcut on home screen to count time

I have an application consists of a button, that starts counting time whenever the button is pressed, and finishes counting when it is pressed again, and so on. 我有一个包含按钮的应用程序,该按钮在每次按下按钮时都会开始计时,而在再次按下时会完成计时,依此类推。

What I want is a shortcut on home screen (if possible, a floating button; if not, just a shortcut) to do the same action as that button. 我想要的是主屏幕上的快捷方式(如果可能,是一个浮动按钮;如果不是,则只是一种快捷方式),以执行与该按钮相同的操作。

Is it possible to define actions for shortcuts? 是否可以定义快捷方式的动作? how can I achieve that? 我该如何实现? minSdkVersion = 16. minSdkVersion = 16。
Thanks in advance. 提前致谢。

Here is the library link which creates a counter floating action bar. 这是一个库链接 ,可创建一个计数器浮动操作栏。

And Here is the tutorial to make that FAB floating like in facebook messenger app. 是使FAB像在Facebook Messenger应用中一样浮动的教程。

What it does is it display's a floating action button as the overlay view when the application is in the background. 它的作用是,当应用程序在后台时,它将一个浮动操作按钮显示为叠加视图。

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

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