Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cda5a0f

Browse files
author
hussienalrubaye
committedSep 26, 2016
files
1 parent 5f657f3 commit cda5a0f

File tree

259 files changed

+7207
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+7207
-0
lines changed
 

‎AlarmManager.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
public void startAlert() {
3+
// for Alarm 25/12/2012 at 12.00
4+
Calendar myAlarmDate = Calendar.getInstance();
5+
myAlarmDate.setTimeInMillis(System.currentTimeMillis());
6+
myAlarmDate.set(2012, 11, 25, 12, 00, 0);
7+
8+
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
9+
10+
Intent intent = new Intent(this, MyBroadcastReceiver.class);
11+
intent.putExtra("MyMessage","HERE I AM PASSING THEPERTICULAR
12+
MESSAGE WHICH SHOULD BE SHOW ON RECEIVER OF ALARM");
13+
PendingIntent pendingIntent = PendingIntent.getBroadcast(
14+
this.getApplicationContext(),
15+
234324243, intent, 0);
16+
alarmManager.set(AlarmManager.RTC_WAKEUP,
17+
myAlarmDate.getTimeInMillis(),_myPendingIntent);
18+
/* Create Repeating Alarm Start After Each 2 Minutes
19+
am.setRepeating(AlarmManager.ELAPSED_REALTIME,myAlarmDate.getTimeInMillis(),
20+
2*60*60,pendingIntent);
21+
*/
22+
}
23+
24+
25+
/* Permission need
26+
<uses-permission android:name="android.permission.VIBRATE" />
27+
28+
29+
*/

‎AlertDialog.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
AlertDialog.Builder alert= new AlertDialog.Builder(this);
2+
alert.setMessage("are you sure to delete")
3+
.setIcon(android.R.drawable.stat_notify_error)
4+
.setTitle("Alert")
5+
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
6+
@Override
7+
public void onClick(DialogInterface dialog, int which) {
8+
//do some thing
9+
}
10+
})
11+
.setNegativeButton("No", new DialogInterface.OnClickListener() {
12+
@Override
13+
public void onClick(DialogInterface dialog, int which) {
14+
//do some thing
15+
}
16+
}).show();

0 commit comments

Comments
 (0)
Please sign in to comment.