Android Notification.Builder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Notification.Builder class.

This code example shows how to use the following methods:setContentText, setContentTitle, setOngoing, setProgress, setSmallIcon
		return mBuilder;
	} 
	 
	private Builder NotificationUploadPrepare(String text){
		 
		Builder mBuilder = new Builder(this);
		 
		/* Setup Notification Manager Begin */ 
		mBuilder.setContentTitle("Download from dCache server");
		mBuilder.setContentText(text);
		mBuilder.setSmallIcon(android.R.drawable.ic_menu_upload);
		mBuilder.setOngoing(true);
		mBuilder.setProgress(100, 0, false);
		/* Setup Notification Manager End */ 
		 
		return mBuilder;
	} 
	 
	@SuppressWarnings("deprecation") 
	private void NotificationNotify(String tag, Builder mBuilder) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:build, setContentText, setContentTitle, setLargeIcon
This code example shows how to use the following methods:getNotification, setContentIntent, setLights, setSound, setVibrate
	private void broadcastNotification(Quake _quake) {
		// TODO Auto-generated method stub 
		Intent startActivityIntenet = new Intent(this, Earthquake.class);
		PendingIntent launchIntent = PendingIntent.getActivity(this, 0,
				startActivityIntenet, 0);
		earthquakeNotificationBuilder.setContentIntent(launchIntent)
				.setWhen(_quake.getDate().getTime())
				.setContentTitle("M: " + _quake.getMagnitude())
				.setContentText(_quake.getDetails());
 
		if (_quake.getMagnitude() > 6) {
			Uri ringURI = RingtoneManager
					.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
 
			earthquakeNotificationBuilder.setSound(ringURI);
		} 
 
		double vibrateLength = 100 * Math.exp(0.53 * _quake.getMagnitude());
		long[] vibrate = new long[] { 100, 100, (long) vibrateLength };
		earthquakeNotificationBuilder.setVibrate(vibrate);

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:build, setContentText, setContentTitle, setLargeIcon
This code example shows how to use the following methods:setSound
    return this;
  } 
 
  @Override 
  public NotificationBuilder setSound(final Uri sound, final int streamType) {
    core.setSound(sound, streamType);
    return this;
  } 
 
  @Override 
  public NotificationBuilder setVibrate(final long[] pattern) {
    core.setVibrate(pattern);
    return this;
  } 
 
  @Override 
  public NotificationBuilder setLights(final int argb, final int onMs, final int offMs) {
    core.setLights(argb, onMs, offMs);
    return this;
  } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setLights
    return this;
  } 
 
  @Override 
  public NotificationBuilder setLights(final int argb, final int onMs, final int offMs) {
    core.setLights(argb, onMs, offMs);
    return this;
  } 
 
  @Override 
  public NotificationBuilder setOngoing(final boolean ongoing) {
    core.setOngoing(ongoing);
    return this;
  } 
 
  @Override 
  public NotificationBuilder setOnlyAlertOnce(final boolean onlyAlertOnce) {
    core.setOnlyAlertOnce(onlyAlertOnce);
    return this;
  } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setProgress
	public void setContentIntent(PendingIntent intent) {
		mInstance.setContentIntent(intent);
	} 
 
	public void setProgress(int max, int progress, boolean indeterminate) {
		mInstance.setProgress(max, progress, indeterminate);
	} 
 
	@SuppressWarnings("deprecation") 
	public void notifyManager(NotificationManager nm, int id) {
		nm.notify(id, mInstance.getNotification());
	} 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android Notification.Builder Questions & Answers:

Other Android Notification.Builder Examples

23:	    // Build notification
24:	    // Actions are just fake
25:	    Notification noti = new Notification.Builder(this)
26:	        .setContentTitle("New mail from " + "test@gmail.com")
27:	        .setContentText("Subject").setSmallIcon(R.drawable.icon)

Read More

See Code Examples for Android Notification.Builder Methods: