alarmmanager

Android: AlarmManager used to call a Service to notify the user

我的未来我决定 提交于 2020-02-02 12:32:11
问题 Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication()

Android: AlarmManager used to call a Service to notify the user

女生的网名这么多〃 提交于 2020-02-02 12:31:05
问题 Edit Adding this line in my manifest solved my problem (the Service is well created). <service android:name=".TimersService" > Post I'm currently trying to implement alarms to notify the user that a countdown has finished. I have a method createAlarm() that adds a new Alarm through an AlarmManager . This method is currently called inside a Fragment. It looks like this: private final void createAlarm(String name, long milliInFuture) { Intent myIntent = new Intent(getActivity().getApplication()

Android基础——闹钟

女生的网名这么多〃 提交于 2020-01-30 23:27:25
有两个活动:一个是Main,用来设定闹钟,另一个是闹钟到点提示的活动Alarm Main布局文件 <?xml version="1.0" encoding="utf-8"?> <TimePicker xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <TimePicker android:id="@+id/time" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap

AlarmManager from service

南笙酒味 提交于 2020-01-25 16:50:51
问题 i have a background Service which starts and AlaramManager. i've logged when the AlarmManager fires and see that it only fires when the application has no activities running and the only thing that runs is the background Service.. why is that ? @Override public int onStartCommand(Intent intent, int flags, int startId) { if (app.isApplicationInitilized()) { //stopAlarmManager(); server.start(); startAlarmManager(); } return START_NOT_STICKY; } public void startAlarmManager() { alarmManager

Did I screw up my System_server service?

限于喜欢 提交于 2020-01-23 12:30:07
问题 My phone is producing a non-stop Log.d output. The following repeats over and over again about 1200 times per second . 04-25 15:58:04.883 1542-5012/? D/NetworkStatsCollection: getHistory:mUID 10266 isVideoCallUID: false PID 1542 is System_server which I've come to understand manages an array of Android services. In the app I'm developing, I use the Alarm Manager and Notification service as seen below. Is there anything I could have done to cause this service to react the way it is? public

Setting up Alarm Manager is creating 2 Instances of my Main Activity

被刻印的时光 ゝ 提交于 2020-01-19 06:16:32
问题 I have 2 activities, a Main Activity and SetAlarm Activity. I call SetAlarm Activity from Main. When I set up the alarm I create an instance of my main. How do I set up the alarm without creating another instance of the Main or do I kill the main before setting up the alarm? Quite new to this. I have read several of the alarm manager examples, but they all seem to set up a new intent and I think this is what is creating my 2 instances. Is this how you set up the alarm. It does go off. Here is

Setting up Alarm Manager is creating 2 Instances of my Main Activity

无人久伴 提交于 2020-01-19 06:11:26
问题 I have 2 activities, a Main Activity and SetAlarm Activity. I call SetAlarm Activity from Main. When I set up the alarm I create an instance of my main. How do I set up the alarm without creating another instance of the Main or do I kill the main before setting up the alarm? Quite new to this. I have read several of the alarm manager examples, but they all seem to set up a new intent and I think this is what is creating my 2 instances. Is this how you set up the alarm. It does go off. Here is

AlarmManager in android runs every time i open the app

a 夏天 提交于 2020-01-17 17:01:53
问题 I have a code for creating an alarmManager main activity Calendar c = Calendar.getInstance(); c.set(Calendar.HOUR_OF_DAY, 14); c.set(Calendar.MINUTE, 41); c.set(Calendar.SECOND, 0); Intent intentAlarm = new Intent(this, AlarmReceiver.class); AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC,c.getTimeInMillis(), pendingIntent.getBroadcast(this, 0, intentAlarm, pendingIntent.FLAG_ONE_SHOT)); In the AlarmReceive class I have:

Android pending Intent - Alarm - same code six(6) apps

倖福魔咒の 提交于 2020-01-17 14:01:21
问题 I found something strange yesterday. While testing app with localization versions(different apps-dif. packages, the same code) I found one interesting bug - the app sets alarm with the AlarmManager and pending Intent - when the broadcast is fired , only one app gets activated and executes the pending intent and all others apps(only different language) are not reacting at all. Is this android bug?? I'm expecting that the set Alarm will trigger every one app that has it's own set Alarm but

AlarmManager is not executing the class in time?

非 Y 不嫁゛ 提交于 2020-01-17 12:26:13
问题 In my project I want to change a flag value in SharedPreference in particular time every day ,I have implemented the AlarmManager but It is not performing the task . My function to call my receiver class : public void changeAttendaceFlag(){ Log.d(TAG,"changeAttendaceFlag !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY,14); calendar.set(Calendar.MINUTE,23); calendar.set(Calendar.SECOND,10); Intent activateLogin = new Intent