Skip to content

Instantly share code, notes, and snippets.

View SeanPONeil's full-sized avatar

Sean O'Neil SeanPONeil

  • LogicGate
  • Ann Arbor, Michigan
View GitHub Profile
@SeanPONeil
SeanPONeil / displayNotificationWithOneAction.java
Last active August 29, 2015 13:59
displayNotificationWithOneAction
public void displayNotification(String title, String message, int icon, int id) {
// Create PendingIntent that launches an activity
Intent intent = new Intent(getContext(), LoginRequestActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);
// Build the notification
Notification notification = new NotificationCompat.Builder()
.setContentTitle(title)
.setContentText(message)
.setSmallIcon(icon)
@SeanPONeil
SeanPONeil / displayNotification.java
Last active August 29, 2015 13:59
displayExpandedNotificationWithMultipleActions
public void displayNotification(String title, String message, int smallIcon, int largeIcon) {
// Create PendingIntent that launches an activity
Intent intent = new Intent(getContext(), LoginRequestActivity.class);
PendingIntent activityIntent = PendingIntent.getActivity(getContext(), 0, intent, PendingIntent.FLAG_ONE_SHOT);
// Build the notification
Notification notification = new NotificationCompat.Builder()
.setContentTitle(title)
.setContentText(message)
.setSmallIcon(smallIcon)
@SeanPONeil
SeanPONeil / receiveNotification.java
Last active August 29, 2015 13:59
receiveNotification
public class NotificationActionReceiver extends WakefulBroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
String action = intent.getStringExtra("action");
int id = intent.getIntExtra("id");
switch (action) {
case "Approve":
// Start service to approve transaction and hold wake lock
Intent approveIntent = new Intent("com.example.app.ApproveService");
intent.putExtra("id", id);

Keybase proof

I hereby claim:

  • I am seanponeil on github.
  • I am seanponeil (https://keybase.io/seanponeil) on keybase.
  • I have a public key whose fingerprint is 6C46 0325 A379 C763 EF36 C51B 32BE 39C5 558F 19A6

To claim this, I am signing this object:

class Node {
char data;
Node next;
}
static Node reverse(Node root){
Node reverseRoot = null;
while(root != null) {
Node next = root.next;
root.next = reverseRoot;

Keybase proof

I hereby claim:

  • I am seanponeil on github.
  • I am seanponeil (https://keybase.io/seanponeil) on keybase.
  • I have a public key ASDDvmJwXIYfULVamNP0aqsGQJCIXwXqn_haFHhrGSqmxgo

To claim this, I am signing this object: