android


Alarm Manager - triggers after every 2 hours


I have following piece of code which gets called once. However notification gets triggered after every 2 hours where as I want it to get triggered after 2 days. I tried all options, but still its not working
public int setAlarm(){
Calendar Calendar_Object = Calendar.getInstance();
/*
Calendar_Object.set(Calendar.MONTH,6);
Calendar_Object.set(Calendar.YEAR, 2013);
Calendar_Object.set(Calendar.DAY_OF_MONTH, 18);*/
// MyView is my current Activity, and AlarmReceiver is the
// BoradCastReceiver
Intent myIntent = new Intent(Splash.this, TimeAlarm.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this,
0, myIntent, PendingIntent.FLAG_CANCEL_CURRENT);
long wkupTime = Calendar_Object.getTimeInMillis() + 36000;
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
// Log.w("alarm set for " , Calendar_Object.getTime().toString ());
/*
* The following sets the Alarm in the specific time by getting the long
* value of the alarm date time which is in calendar object by calling
* the getTimeInMillis(). Since Alarm supports only long value , we're
* using this method.
*/
// alarmManager.setRepeating(AlarmManager.RTC, Calendar_Object.getTimeInMillis(),1000 *24*3600,
// pendingIntent);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, wkupTime , 172800000, pendingIntent);
return 0;
public int setAlarm() {
Calendar Calendar_Object = Calendar.getInstance();
Intent myIntent = new Intent(Splash.this, TimeAlarm.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this,
0, myIntent, PendingIntent.FLAG_CANCEL_CURRENT);
long wkupTime = Calendar_Object.getTimeInMillis() + 72000;
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, wkupTime ,7200000, pendingIntent);
return 0;
}

Related Links

How to do an in app purchase in AIR for Android?
kill an alarm checker in android
Android - How to know the long-pressed text in the TextView?
Returning _id from SQLite update using SQLiteCursorLoader
Lazy loading carousel
Android, Display data without HTML tags
Programming google calendar API within eclipse android java
How to convert a google charts graph to image in android?
animation with cocos2d android
Location animation using blue flashing arrow and show direction in Android Google Map
ADT tool chain not producing output for static libraries
mark the particular setting from my App in android
Space between elements of the indicator
NoSuchMethod: isDestroyed()
App force closing when turning screen off
Robolectric compilation error while using shadowOf method

Categories

HOME
embedded
apache-flink
phpmyadmin
yahoo-finance
javacc
yandex
maxscript
mapbox
banner
joomla3.0
rcloud
p2p
project
appcelerator-studio
watson-conversation
project-intu
intercom
favicon
frequency-distribution
plink
symfony-2.8
firefox-addon
dimensional-modeling
ksh
joptionpane
pchart
paragraph
catch-unit-test
simplecv
getpixel
least-squares
navigator
reason
google-knowledge-graph
openalpr
c9.io
signals-slots
sharp-snmp
plr
chronicle-map
knime
apache-directory
flask-login
stylecop
servermanager
flask-restful
httrack
tinymce-3
backbone-collections
objectscript
sandcastle
pure-css
actor-platform
hadoop-2.7.2
webjars
mediametadataretriever
query-by-example
boost-serialization
beanstalk
false-sharing
crouton-os
iokit
xvim
ember-cli-rails
haskell-warp
infosphere-spl
crowd
device-tree
strawberry-perl
unix-socket
jjaql
multitasking
ecslidingviewcontroller
hibernate-entitymanager
nebula
veracity
database-create
node-redis
exponentiation
webdev.webserver
ruby-1.8
objective-j
cruisecontrol.rb
jqueryform
web-garden
murmurhash
interop-domino
soappy
pbcopy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App