Notification setLatestEventInfo - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Notification setLatestEventInfo method.

This code example shows how to use the following methods:setLatestEventInfo
Context c = getActivity();
		if (c == null) {
			c = TiApplication.getInstance().getApplicationContext();
		} 
		notification.setLatestEventInfo(c, contentTitle, contentText, contentIntent.getPendingIntent());
	} 
 
	public Notification getNotification()
	{  
		return notification;
	} 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
	    NotificationManager manger = (NotificationManager) context
	            .getSystemService(context.NOTIFICATION_SERVICE);
 
		Intent mainIntent = new Intent("ti.intent.action.calendar.ALARM");
 
	    Notification notification = new Notification(0x7f020000,
	            "", System.currentTimeMillis());
	    PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
	            mainIntent, 0);
	//TEST 
		notification.setLatestEventInfo(context,"Payment Reminder","Send me to jhaynie@appcelerator.com",contentIntent);
	    manger.notify(1, notification);
	} 
} 
 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
This code example shows how to use the following methods:setLatestEventInfo
@RunWith(TestRunners.WithDefaults.class) 
public class NotificationTest { 
  @Test 
  public void setLatestEventInfo__shouldCaptureContentIntent() throws Exception { 
    PendingIntent pendingIntent = PendingIntent.getActivity(new Activity(), 0, new Intent(), 0);
    Notification notification = new Notification();
    notification.setLatestEventInfo(new Activity(), "title", "content", pendingIntent);
    assertSame(pendingIntent, notification.contentIntent);
  } 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
	    NotificationManager manger = (NotificationManager) context
	            .getSystemService(context.NOTIFICATION_SERVICE);
 
		Intent mainIntent = new Intent("ti.intent.action.calendar.ALARM");
 
	    Notification notification = new Notification(0x7f020000,
	            "", System.currentTimeMillis());
	    PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
	            mainIntent, 0);
	//TEST 
		notification.setLatestEventInfo(context,"Payment Reminder","Send me to jhaynie@appcelerator.com",contentIntent);
	    manger.notify(1, notification);
	} 
} 
 
-307
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
@RunWith(TestRunners.WithDefaults.class) 
public class NotificationTest { 
    @Test 
    public void setLatestEventInfo__shouldCaptureContentIntent() throws Exception { 
        PendingIntent pendingIntent = PendingIntent.getActivity(new Activity(), 0, new Intent(), 0);
        Notification notification = new Notification();
        notification.setLatestEventInfo(new Activity(), "title", "content", pendingIntent);
        assertSame(pendingIntent, notification.contentIntent);
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
     * @param icon The id of a drawable to be used as the small icon. Will display on all platforms. 
     * @param thumb A bitmap representing the currently playing item. Ignored on lower API levels. 
     * @return 
     */ 
    public Notification build(String title, String text, int icon, Bitmap thumb) {
        Notification notification = new Notification(icon, title, System.currentTimeMillis());
        notification.setLatestEventInfo(mContext, title, text, mIntent);
        return finalize(notification);
    } 
 
    /** 
     * Perform modifications to a notification that apply to all API levels. All definitions of 
     * buildNotification should call this before returning. 
     */ 
    protected Notification finalize(Notification notification) {
        notification.flags |= Notification.FLAG_ONGOING_EVENT;
        return notification;
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
        this.promptNotificationId = completionNotificationId + 1;
        notificationManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
    } 
 
    public Notification createNotificationWith(OpNotification opn) {
        Notification n = new Notification(opn.getDrawable(), opn.getTickerText(), currentTimeMillis());
        n.setLatestEventInfo(context, opn.getEventTitle(), opn.getEventDetail(), manageGitRepo);
        return n;
    } 
 
    public void cancelOngoingNotification() { 
        notificationManager.cancel(ongoingOpNotificationId);
    } 
 
    public void clearPromptNotification() { 
        notificationManager.cancel(promptNotificationId);
    } 
 
    public void notifyPromptWith(OpNotification opNotification) {
        Notification n = createNotificationWith(opNotification);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo
    @Override 
    public void onReceive(Context context, Intent intent) {
        NotificationManager mNotificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        // Set the icon, scrolling text and timestamp 
        Notification notification = new Notification(android.R.drawable.stat_notify_error, "Welcome",
                System.currentTimeMillis());
 
        // The PendingIntent to launch our activity if the user selects this 
        // notification 
        PendingIntent contentIntent = PendingIntent
                .getActivity(context, 0, new Intent(context, ClockActivity.class), 0);
 
        // Set the info for the views that show in the notification panel. 
        notification.setLatestEventInfo(context, "ClockActivity", "Les exemples Digit books sont install�s", contentIntent);
 
        // Send the notification. 
        // We use a string id because it is a unique number. We use it later to 
        // cancel. 
        mNotificationManager.notify(NOTIFICATION_ID, notification);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:setLatestEventInfo, sleep
	} 
    } 
 
    private void showNotification(String message) {
	long currentTime = System.currentTimeMillis();
	Notification notification = new Notification(android.R.drawable.stat_notify_sync, message, currentTime);
	notification.flags = Notification.FLAG_AUTO_CANCEL;
	notification.setLatestEventInfo(this, "Open eCard App", "", null);
	notificationManager.notify(NOTIFICATION_ID, notification);
	try { 
	    // wait 2 secs before closing the notification, else it won't be seen on tablets 
	    Thread.sleep(2000);
	} catch (InterruptedException e) {
	    // ignore 
	} 
	notificationManager.cancel(NOTIFICATION_ID);
    } 
 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Notification setLatestEventInfo Questions & Answers:

Other Notification setLatestEventInfo Examples

102:	        PendingIntent intent =
103:	                PendingIntent.getActivity(context, 0, notificationIntent, 0);
104:	        notification.setLatestEventInfo(context, title, message, intent);
105:	        notification.flags |= Notification.FLAG_AUTO_CANCEL;
106:

Read More

setLatestEventInfo Method Overview
This method was deprecated in API level 11. Use Notification.Builder instead.
See Code Examples for other Android Notification Methods: