alarmmanager

Android AlarmManager setRepeating Issue

爱⌒轻易说出口 提交于 2019-12-13 05:18:43
问题 I'm developing a feeder application, and i have the option that let the user choose for each source (feed source) specify the time to get data from the internet and update the database. I'm using AlarmManager for this. What i do tipically is: Get all providers. Group in a map> that the key is the sleep time and value is a list of providers For what?... Well i iterate later over this dictionary for each key and schedule an alarm to send a broadcast with data in a intent. In my broadcast

How i can cancel an alarm after a period of time? | android

▼魔方 西西 提交于 2019-12-13 05:13:17
问题 hi i have an alarm here and i want a way to cancel it AFTER a period of time like a day for example or a week ,,, and thanks in advance ,, am = (AlarmManager)parent.getContext().getSystemService(Context.ALARM_SERVICE); //the title and the description of the notification Intent alarmintent = new Intent(parent.getContext(), Alarm_Receiver.class); alarmintent.putExtra("title",titlePills + dea22); alarmintent.putExtra("note",dea22); alarmintent.putExtra("NOTIFICATION_ID",String.valueOf

Start Service at specific time everyday by alarmanager dont work

荒凉一梦 提交于 2019-12-13 04:47:16
问题 I want to start a service at specific time everyday and then service launch notification every min, well service work fine alone but when its called by the alarmmanager nothing happens. Here alarm code: Calendar cur_cal = new GregorianCalendar(); cur_cal.setTimeInMillis(System.currentTimeMillis());//set the current time and date for this calendar Calendar cal = new GregorianCalendar(); cal.add(Calendar.DAY_OF_YEAR, cur_cal.get(Calendar.DAY_OF_YEAR)); cal.set(Calendar.HOUR_OF_DAY, 20); cal.set

BroadcastReceiver from AlarmManager not getting called

自闭症网瘾萝莉.ら 提交于 2019-12-13 04:44:53
问题 I have a class that extends IntentService . The stuff in this class is called when my app reboots (and also on app startup). It loads some settings and does some stuff in the background (it's a productivity tool/utility). This IntentService , when loading my, let's call it "stuff" , decides whether or not to add some alarms via AlarmManager . I have a BroadcastReceiver that receives some different parameters and does some method based on those parameters. Here is the code in which I am

set Android alarm - Reminder app

你说的曾经没有我的故事 提交于 2019-12-13 04:41:37
问题 I follow this example to set up alarm. This is the MainActivity class extends with Droidgap @SuppressLint({ "JavascriptInterface", "SetJavaScriptEnabled" }) public class MainActivity extends DroidGap { //CordovaWebView cwv; final static public long ONE_SECOND = 1000; final static public long TWENTY_SECONDS = ONE_SECOND * 20; public PendingIntent pi; public BroadcastReceiver br; public AlarmManager am; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Kill Application

帅比萌擦擦* 提交于 2019-12-13 03:55:59
问题 I want to kill my app after 10 second, I want to start service that kill app after getting Kill Action. But this code noting after 10 second. Why? AlarmManager alarmMgr = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(this, service_MyService.class); intent.setAction("Kill"); PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,intent, 0); Calendar time = Calendar.getInstance(); time.setTimeInMillis(System.currentTimeMillis()); time.add(Calendar

Alarm is not triggering on the same Date

北慕城南 提交于 2019-12-13 03:46:44
问题 I want to reboot device on particular time so i am using alarm manager for that.below is the code of my activity. public class MainActivity extends AppCompatActivity { private static int timeHour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); private static int timeMinute = Calendar.getInstance().get(Calendar.MINUTE); AlarmManager alarmManager; private PendingIntent pendingIntent; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

How to stop Android AlarmManager when there is a manual system time change?

岁酱吖の 提交于 2019-12-13 03:34:09
问题 Here is an extended example of the problem. It is 1:30AM. Alarm is set for later today, at 10AM. I change my phones time to 1159PM yesterday. Alarm Manager instantly triggers, at the wrong time. How do I stop the AlarmManager from ringing if the time is in the past? If however, I change the time forward, nothing happens. I do not want this to happen with my app, as it does not happen with other Alarm apps. Is there a way to make sure that the Alarm manager only rings at the exact minute it is

AlarmManager Not called next day if the app sleeps for abt 1 day

白昼怎懂夜的黑 提交于 2019-12-13 03:23:39
问题 I am developing an android app which shows a notification every 12 hour if the time is saved in the database. So everytime a data is entered or edited in the database ,I cancel the current alarmmanager and start a fresh new one so that I dont miss one. Also on reboot I have called the alarmmanager. On the broadcast receiver, the database is checked for entry and if found a notification is set and the app is opened automatically. So when I test the app by changing the date manually,the app

how to update fragment on clock time

浪子不回头ぞ 提交于 2019-12-13 03:17:39
问题 I'm trying to update fragment on clock time, say for example 8PM, with below logic. Unfortunately, it doesn't update the fragment. Any help/reference would be appreciated. What I did: registered an AlarmManager in app's Application class as below: alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent().setAction(AppConstants.INTENT_ACTION_UPDATE_DASHBOARD); alarmIntent = PendingIntent.getBroadcast(context, 0, intent, 0); // Set the alarm to