[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[LEFT]public[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] alarmsetter_activity [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extends[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Activity{
[/SIZE][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]protected[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] onCreate(Bundle savedInstanceState) {
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].onCreate(savedInstanceState);
Intent myIntent = [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Intent(getBaseContext(),
myreceiver.[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
myIntent.setAction([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"com.try1.pratice1.ACTION"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
PendingIntent pendingIntent
= PendingIntent.[I]getBroadcast[/I](getBaseContext(),
0, myIntent, 0);
AlarmManager alarmManager
= (AlarmManager)getSystemService([/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ALARM_SERVICE[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
Calendar calendar = Calendar.[I]getInstance[/I]();
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//calendar.setTimeInMillis(System.currentTimeMillis()); [/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//calendar.set(Calendar.DAY_OF_MONTH, 22);[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]calendar.set(Calendar.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]HOUR_OF_DAY[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],7);
calendar.set(Calendar.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]MINUTE[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], 0);
calendar.set(Calendar.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]AM_PM[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], Calendar.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]AM[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (calendar.getTimeInMillis()<System.[I]currentTimeMillis[/I]()) {
calendar.add(Calendar.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]DAY_OF_YEAR[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], 1);
}
alarmManager.setRepeating(AlarmManager.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]RTC_WAKEUP[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],calendar.getTimeInMillis(),
AlarmManager.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]INTERVAL_DAY[/I][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], pendingIntent);
finish();
}
}
 [/LEFT]
[/SIZE]