Tecnologia do Blogger.
RSS

[androidbrasil-dev] AlarmManager

Galera, ajudem-me se possível. Acho que estou meninando  / manelando, em alguma coisa muito besta. Estou tentando fazer um AlarmManager dentro de um aplicativo, onde estou guardando os dados no sqlite3, e estou setando como TriggerTime um TimeStamp, o timeStamp está correto. 

Eu estou agendando o alarme na hora em que eu salvo o registro no banco, assim que ele insere o registro no banco ele já 'toca' o alarme. Alguém sabe me dizer o que posso esta fazendo errado.

private void alarm(long start_date) {


database.open();

  long id = database.returnLast();

  database.close();

 

        Intent intent = new Intent(NewPrayerActivity.this, AlarmReceiver.class);

        Bundle extras = new Bundle();

extras.putLong("id", id);

intent.putExtras(extras);

        

        PendingIntent sender = PendingIntent.getBroadcast(this, 192837, intent, PendingIntent.FLAG_UPDATE_CURRENT);

        

        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);

        

        long triggerTime = start_date;

        am.set(AlarmManager.RTC_WAKEUP, triggerTime, sender);

    }


-- 
kleverson
Sent with Sparrow

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário