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

18
LINES

< > BotCompany Repo | #1004166 // Android: Try to set repeating alarm

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (57L/1K/2K).

1  
!752
2  
3  
import android.app.*;
4  
import android.content.*;
5  
6  
p {
7  
  Activity context = androidContext();
8  
  AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
9  
  
10  
  Class receiverClass = Class.forName("de.tinybrain.javax_allperms.AlarmManagerReceiver");
11  
 
12  
  Intent intent = new Intent(context, receiverClass);
13  
  
14  
  PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);
15  
  
16  
  int firstDelayMS = 1000*5, intervalMS = 1000*10;
17  
  am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+firstDelayMS, intervalMS, pi); 
18  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004166
Snippet name: Android: Try to set repeating alarm
Eternal ID of this version: #1004166/1
Text MD5: 04ad5d14c97c5de6db890b6adbd2bebf
Transpilation MD5: 8d4b5fe942a578e0ea0cdaeb5bcb98fb
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-08 22:28:06
Source code size: 581 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 496 / 541
Referenced in: [show references]