AlarmManager manager = (AlarmManager)MainActivity.this.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(MainActivity.this, DemoReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
manager.setInexactRepeating(AlarmManager.RTC, 0, 20000, pendingIntent);
我设置20秒的时间间隔来呼叫闹钟,但是拨打1-1.10分钟来呼叫
答案 0 :(得分:0)
试试这个
manager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 0, 20000, pendingIntent);
答案 1 :(得分:0)
你使用的是哪个Android版本?
显然,您无法在Android AlarmManager中设置非常短的间隔。