GithubHelp home page GithubHelp logo

android-alarmmanagerclock's Issues

取消闹钟不起作用

测试貌似取消闹钟不起作用,传入三个参数,第一个是activity(context),第二个是设置的action名(肯定没错,设置闹钟的时候也是这个action名成功了,写到一个静态变量里的),第三个参数就是id号

关于修改系统时间,闹钟不正确的问题

因为前段时间,也做了个闹钟的功能,也遇到了这些问题,也是这样搞定的。
如果用户,修改了系统的时间,如果我们设置之前就设置一个时间,那么就会触发这个过期闹钟任务。
我的解决方案如下:
    在我们触发的Receive中,加一个时间差的比较:
    代码如下:
    private final static int STALE_WINDOW = 60;//60秒
long now = System.currentTimeMillis();
  if (intent.hasExtra("time")) {
  long sendTime = intent.getLongExtra("time", -1);//闹钟触发的时间
  if (now > sendTime + STALE_WINDOW * 1000) {
  return;
  }

还有一个是如果用户修改系统的时间,我们应试在清单中注册一下几个广播,得新设置一个闹钟。

"ANDROID.INTENT.ACTION.BOOT_COMPLETED"
"android.intent.action.TIME_SET"
"ANDROID.INTENT.ACTION.TIME_TICK"
"ANDROID.INTENT.ACTION.TIMEZONE_CHANGED"

设置时间倒时不起作用

我想设置明天7点的闹钟,不起作用,比如现在时间是10点,我设置10点5分的就没有问题,不能设置第二天的吗,

关于重复提醒的问题。

如果涉及到每周的周一到周五提醒,那个week应该怎么传值?还是说要设置五个闹钟,周一到周五的,一周为周期

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.