Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1004168 // androidEnableRepeatingAlarm

JavaX fragment (include)

1  
import android.app.*;
2  
import android.content.*;
3  
import android.os.SystemClock;
4  
5  
static void androidEnableRepeatingAlarm(int firstDelayMS, int repeatingDelayMS, S alarmSnippetID) ctex {
6  
  Activity context = androidActivity();
7  
  AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
8  
  Class receiverClass = Class.forName("de.tinybrain.javax_allperms.AlarmManagerReceiver");
9  
  Intent intent = new Intent(context, receiverClass);
10  
  intent.putExtra("snippetID", str(parseSnippetID(alarmSnippetID)));
11  
  PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);
12  
  //am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+firstDelayMS, repeatingDelayMS, pi);
13  
  am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+firstDelayMS, repeatingDelayMS, pi); 
14  
}

Author comment

Began life as a copy of #1004166

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1004168
Snippet name: androidEnableRepeatingAlarm
Eternal ID of this version: #1004168/1
Text MD5: 1ad045e42d3c35f645000bc4f5d3ddd1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-05 14:11:18
Source code size: 842 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 640 / 628
Referenced in: [show references]