Java Code Examples for android.support.v4.app.NotificationCompat.Builder

The following are Jave code examples for showing how to use Builder of the android.support.v4.app.NotificationCompat class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: sealtalk-android-master   File: UpdateService.java   View Source Code Vote up 6 votes
private void buildNotification() {


        boolean isLollipop = (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP);
        int smallIcon = getResources().getIdentifier("notification_small_icon", "drawable", getPackageName());

        if (smallIcon <= 0 || !isLollipop) {
            smallIcon = getApplicationInfo().icon;
        }

        manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        builder = new NotificationCompat.Builder(this);
        builder.setContentTitle(getString(R.string.update_app_model_prepare))
                .setWhen(System.currentTimeMillis())
                .setProgress(100, 1, false)
        .setSmallIcon(smallIcon)
        .setLargeIcon(BitmapFactory.decodeResource(
                          getResources(), icoResId))
        .setDefaults(downloadNotificationFlag);

        manager.notify(notifyId, builder.build());
    }
 
Example 2
Project: Cable-Android   File: ApplicationMigrationService.java   View Source Code Vote up 6 votes
private NotificationCompat.Builder initializeBackgroundNotification() {
  NotificationCompat.Builder builder = new NotificationCompat.Builder(this);

  builder.setSmallIcon(R.drawable.icon_notification);
  builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.icon_notification));
  builder.setContentTitle(getString(R.string.ApplicationMigrationService_importing_text_messages));
  builder.setContentText(getString(R.string.ApplicationMigrationService_import_in_progress));
  builder.setOngoing(true);
  builder.setProgress(100, 0, false);
  builder.setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, ConversationListActivity.class), 0));

  stopForeground(true);
  startForeground(4242, builder.build());

  return builder;
}
 
Example 3
Project: open-rmbt   File: RMBTLoopService.java   View Source Code Vote up 6 votes
private void setNotificationText(NotificationCompat.Builder builder)
{
    final Resources res = getResources();
    
    final long now = SystemClock.elapsedRealtime();
    final long lastTestDelta = loopModeResults.getLastTestTime() == 0 ? 0 : now - loopModeResults.getLastTestTime();
    
    final String elapsedTimeString = LoopModeTriggerItem.formatSeconds(Math.round(lastTestDelta / 1000), 1);
    
    final CharSequence textTemplate = res.getText(R.string.loop_notification_text_without_stop);
    final CharSequence text = MessageFormat.format(textTemplate.toString(), 
    		loopModeResults.getNumberOfTests(), elapsedTimeString, Math.round(loopModeResults.getLastDistance()));
    builder.setContentText(text);
    
    if (bigTextStyle == null)
    {
        bigTextStyle = (new NotificationCompat.BigTextStyle());
        builder.setStyle(bigTextStyle);
    }
    
    bigTextStyle.bigText(text);
}
 
Example 4
Project: unity-obb-downloader   File: DownloadNotification.java   View Source Code Vote up 6 votes
/**
 * Constructor
 *
 * @param ctx The context to use to obtain access to the Notification
 *            Service
 */
DownloadNotification(Context ctx, CharSequence applicationLabel) {
    mState = -1;
    mContext = ctx;
    mLabel = applicationLabel;
    mNotificationManager = (NotificationManager)
            mContext.getSystemService(Context.NOTIFICATION_SERVICE);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        mActiveDownloadBuilder = new V4CustomNotificationBuilder(ctx);
    } else {
        mActiveDownloadBuilder = new NotificationCompat.Builder(ctx);
    }
    mBuilder = new NotificationCompat.Builder(ctx);

    // Set Notification category and priorities to something that makes sense for a long
    // lived background task.
    mActiveDownloadBuilder.setPriority(NotificationCompat.PRIORITY_LOW);
    mActiveDownloadBuilder.setCategory(NotificationCompat.CATEGORY_PROGRESS);

    mBuilder.setPriority(NotificationCompat.PRIORITY_LOW);
    mBuilder.setCategory(NotificationCompat.CATEGORY_PROGRESS);

    mCurrentBuilder = mBuilder;
}
 
Example 5
Project: event-me   File: MyFirebaseMessagingService.java   View Source Code Vote up 6 votes
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    super.onMessageReceived(remoteMessage);
    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
    mBuilder.setSmallIcon(R.drawable.logo);
    mBuilder.setContentTitle(remoteMessage.getNotification().getTitle());
    mBuilder.setContentText(remoteMessage.getNotification().getBody());
    Intent i = new Intent(this,MainActivity.class);
    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    i.putExtra("from","iside");
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, i,
            PendingIntent.FLAG_UPDATE_CURRENT);
    mBuilder.setContentIntent(contentIntent);
    NotificationManager mNotificationManager =
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    mNotificationManager.notify(79, mBuilder.build());

}
 
Example 6
Project: CustomAndroidOneSheeld   File: NotificationShield.java   View Source Code Vote up 6 votes
protected void showNotification(String notificationText) {
    // TODO Auto-generated method stub
    NotificationCompat.Builder build = new NotificationCompat.Builder(
            activity);
    build.setSmallIcon(OneSheeldApplication.getNotificationIcon());
    build.setContentTitle(notificationText);
    build.setContentText(activity.getString(R.string.notifications_notification_received_from_1sheeld));
    build.setTicker(notificationText);
    build.setWhen(System.currentTimeMillis());
    Toast.makeText(activity, notificationText, Toast.LENGTH_SHORT).show();
    Vibrator v = (Vibrator) activity
            .getSystemService(Context.VIBRATOR_SERVICE);
    v.vibrate(1000);
    Intent notificationIntent = new Intent(activity, MainActivity.class);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
            | Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent intent = PendingIntent.getActivity(activity, 0,
            notificationIntent, 0);
    build.setContentIntent(intent);
    Notification notification = build.build();
    NotificationManager notificationManager = (NotificationManager) activity
            .getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.notify(2, notification);
}
 
Example 7
Project: DaiGo   File: NotificationUtil.java   View Source Code Vote up 5 votes
public NotificationCompat.Builder getNotificationBuilder(String title, String content) {
    NotificationCompat.Builder builder = new NotificationCompat.Builder(
            getApplicationContext());
    builder.setContentText(content);
    builder.setContentTitle(title);
    builder.setSmallIcon(R.drawable.ic_stat_kangaroo);
    builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher));
    builder.setAutoCancel(true);
    return builder;
}
 
Example 8
Project: GeekZone   File: NotificationUtils.java   View Source Code Vote up 5 votes
public static NotificationCompat.Builder makeActivityBuilder(int iconRes, CharSequence title,
                                                             CharSequence text,
                                                             Class<?> activityClass,
                                                             Context context) {
    return makeActivityBuilder(iconRes, title, text, new Intent(context, activityClass),
            context);
}
 
Example 9
Project: Saiy-PS   File: NotificationHelper.java   View Source Code Vote up 5 votes
/**
 * Show an emotion analysis notification.
 *
 * @param ctx the application context
 */
public static void createIdentificationNotification(@NonNull final Context ctx, final int condition,
                                                    final boolean success, @Nullable final Speaker.Confidence confidence) {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "createIdentificationNotification");
    }

    try {

        final Intent actionIntent = new Intent(NotificationService.INTENT_CLICK);
        actionIntent.setPackage(ctx.getPackageName());
        actionIntent.putExtra(NotificationService.CLICK_ACTION,
                NotificationService.NOTIFICATION_IDENTIFICATION);
        actionIntent.putExtra(LocalRequest.EXTRA_CONDITION, condition);

        switch (condition) {

            case Condition.CONDITION_IDENTIFY:
                actionIntent.putExtra(Speaker.EXTRA_IDENTIFY_OUTCOME, confidence);
                break;
            case Condition.CONDITION_IDENTITY:
                actionIntent.putExtra(Speaker.EXTRA_IDENTITY_OUTCOME, success);
                break;
        }

        final PendingIntent pendingIntent = PendingIntent.getService(ctx,
                NotificationService.NOTIFICATION_IDENTIFICATION,
                actionIntent, PendingIntent.FLAG_CANCEL_CURRENT);

        final NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx, NOTIFICATION_CHANNEL_INFORMATION);

        builder.setContentIntent(pendingIntent).setSmallIcon(android.R.drawable.ic_menu_info_details)
                .setTicker(ctx.getString(R.string.vocal_notification_ticker)).setWhen(System.currentTimeMillis())
                .setContentTitle(ctx.getString(ai.saiy.android.R.string.app_name))
                .setContentText(ctx.getString(R.string.vocal_notification_text))
                .setAutoCancel(true);

        final Notification not = builder.build();
        final NotificationManager notificationManager = (NotificationManager)
                ctx.getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.notify(NotificationService.NOTIFICATION_IDENTIFICATION, not);

    } catch (final Exception e) {
        if (DEBUG) {
            MyLog.e(CLS_NAME, "createIdentificationNotification failure");
            e.printStackTrace();
        }
    }
}
 
Example 10
Project: Cable-Android   File: RegistrationNotifier.java   View Source Code Vote up 5 votes
@Override
public void onReceive(Context context, Intent intent) {
  NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
  builder.setSmallIcon(R.drawable.icon_notification);
  builder.setContentTitle(intent.getStringExtra(RegistrationService.NOTIFICATION_TITLE));
  builder.setContentText(intent.getStringExtra(RegistrationService.NOTIFICATION_TEXT));
  builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationListActivity.class), 0));
  builder.setWhen(System.currentTimeMillis());
  builder.setDefaults(Notification.DEFAULT_VIBRATE);
  builder.setAutoCancel(true);

  Notification notification = builder.build();
  ((NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(31337, notification);
}
 
Example 11
Project: Lunary-Ethereum-Wallet   File: NotificationService.java   View Source Code Vote up 5 votes
private void sendNotification(String address, String amount) {
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.ic_notification)
            .setLargeIcon(Blockies.createIcon(address.toLowerCase()))
            .setColor(0x2d435c)
            .setTicker(getString(R.string.notification_ticker))
            .setLights(Color.CYAN, 3000, 3000)
            .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)
            .setContentTitle(this.getResources().getString(R.string.notification_title))
            .setAutoCancel(true)
            .setContentText(amount + " ETH");

    if (android.os.Build.VERSION.SDK_INT >= 18) // Android bug in 4.2, just disable it for everyone then...
        builder.setVibrate(new long[]{1000, 1000});

    final NotificationManager mNotifyMgr =
            (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

    Intent main = new Intent(this, MainActivity.class);
    main.putExtra("STARTAT", 2);

    PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
            main, PendingIntent.FLAG_UPDATE_CURRENT);

    builder.setContentIntent(contentIntent);

    final int mNotificationId = (int) (Math.random() * 150);
    mNotifyMgr.notify(mNotificationId, builder.build());
}
 
Example 12
Project: phonk   File: BaseNotification.java   View Source Code Vote up 5 votes
public void show(Class<?> cls, int icon, String text, String title, int actionIcon) {
    CharSequence tickerText = "MWM";
    mIsShowing = true;

    long when = System.currentTimeMillis();

    Intent notificationIntent = new Intent(c, cls);
    PendingIntent contentIntent = PendingIntent.getActivity(c, 0, notificationIntent, 0);

    Intent stopServerIntent = new Intent();
    stopServerIntent.setAction("com.makewithmoto.intent.action.STOP_SERVER");
    PendingIntent stopServerPendingIntent = PendingIntent.getBroadcast(c, 0, stopServerIntent,
            PendingIntent.FLAG_UPDATE_CURRENT);

    mBuilder = new NotificationCompat.Builder(c);
    mBuilder.setContentTitle(title).setContentText(text).setSmallIcon(icon).setOngoing(true)
            .setProgress(0, 0, true).setContentIntent(contentIntent)
            // .setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
            .addAction(actionIcon, "Stop server", stopServerPendingIntent);

    // notification.defaults |= Notification.DEFAULT_LIGHTS;
    // notification.ledARGB = Color.RED;
    // notification.ledOffMS = 300;
    // notification.ledOnMS = 300;

    // notification.defaults |= Notification.DEFAULT_SOUND;

    mNotificationManager.notify(NOTIFICATION_APP_RUNNING, mBuilder.build());

}
 
Example 13
Project: FLFloatingButton   File: ChatHeadService.java   View Source Code Vote up 5 votes
/**
 * 通知を表示します。
 * クリック時のアクションはありません。
 */
private Notification createNotification() {
    final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
    builder.setWhen(System.currentTimeMillis());
    builder.setSmallIcon(R.mipmap.ic_launcher);
    builder.setContentTitle(getString(R.string.chathead_content_title));
    builder.setContentText(getString(R.string.content_text));
    builder.setOngoing(true);
    builder.setPriority(NotificationCompat.PRIORITY_MIN);
    builder.setCategory(NotificationCompat.CATEGORY_SERVICE);

    return builder.build();
}
 
Example 14
Project: GitHub   File: CountlyMessagingService.java   View Source Code Vote up 5 votes
protected void notify(Intent proxy) {
    Message msg = proxy.getParcelableExtra(CountlyMessaging.EXTRA_MESSAGE);

    if (isAppInForeground(this)) {
        // Go with dialog
        proxy.putExtra(CountlyMessaging.NOTIFICATION_SHOW_DIALOG, true);
        proxy.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(proxy);
    } else {
        // Notification case
        NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, proxy, PendingIntent.FLAG_UPDATE_CURRENT);

        // Get icon from application or use default one
        int icon;
        try {
            icon = getPackageManager().getApplicationInfo(getPackageName(), 0).icon;
        } catch (PackageManager.NameNotFoundException e) {
            icon = android.R.drawable.ic_dialog_email;
        }

        NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext())
                .setAutoCancel(true)
                .setSmallIcon(icon)
                .setTicker(msg.getNotificationMessage())
                .setContentTitle(msg.getNotificationTitle(getApplicationContext()))
                .setContentText(msg.getNotificationMessage())
                .setContentIntent(contentIntent);

        if (msg.hasSoundDefault()) {
            builder.setDefaults(Notification.DEFAULT_SOUND);
        } else if (msg.hasSoundUri()) {
            builder.setSound(Uri.parse(msg.getSoundUri()));
        }

        manager.notify(NOTIFICATION_ID, builder.build());
    }
}
 
Example 15
Project: Channelize   File: AppNotifications.java   View Source Code Vote up 5 votes
public static Notification createForegroundNotifications(Context context) {
    NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context);
    mBuilder.setSmallIcon(R.drawable.ic_notification)
            .setContentTitle(context.getString(R.string.app_name))
            .setContentText(FocusTaskChangedEvent.currentFocusTask.getToDoName());

    Intent resultIntent = new Intent(context, MainActivity.class);
    PendingIntent resultPendingIntent =
            PendingIntent.getActivity(context, 0, resultIntent,
                    PendingIntent.FLAG_UPDATE_CURRENT);
    mBuilder.setContentIntent(resultPendingIntent);

    return mBuilder.build();
}
 
Example 16
Project: chromium-for-android-56-debug-video   File: DownloadNotificationService.java   View Source Code Vote up 4 votes
/**
 * Helper method to update the notification for an active download, the download is either in
 * progress or pending.
 * @param downloadGuid GUID of the download.
 * @param fileName File name of the download.
 * @param percentage Percentage completed. Value should be between 0 to 100 if
 *        the percentage can be determined, or -1 if it is unknown.
 * @param timeRemainingInMillis Remaining download time in milliseconds.
 * @param startTime Time when download started.
 * @param isOffTheRecord Whether the download is off the record.
 * @param canDownloadWhileMetered Whether the download can happen in metered network.
 * @param isOfflinePage Whether the download is for offline page.
 * @param isDownloadPending Whether the download is pending.
 */
private void updateActiveDownloadNotification(String downloadGuid, String fileName,
        int percentage, long timeRemainingInMillis, long startTime, boolean isOffTheRecord,
        boolean canDownloadWhileMetered, boolean isOfflinePage, boolean isDownloadPending) {
    if (mStopPostingProgressNotifications) return;
    String contentText = mContext.getResources().getString(isDownloadPending
            ? R.string.download_notification_pending : R.string.download_started);
    int resId = isDownloadPending ? R.drawable.ic_download_pending
            : android.R.drawable.stat_sys_download;
    NotificationCompat.Builder builder = buildNotification(
            resId, fileName, contentText);
    boolean indeterminate = (percentage == INVALID_DOWNLOAD_PERCENTAGE) || isDownloadPending;
    builder.setOngoing(true);
    // Avoid moving animations while download is not downloading.
    if (!isDownloadPending) {
        builder.setProgress(100, percentage, indeterminate);
    }
    builder.setPriority(Notification.PRIORITY_HIGH);
    if (!indeterminate && !isOfflinePage) {
        String duration = formatRemainingTime(mContext, timeRemainingInMillis);
        if (Build.VERSION.CODENAME.equals("N")
                || Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            builder.setSubText(duration);
        } else {
            builder.setContentInfo(duration);
        }
    }
    int notificationId = getNotificationId(downloadGuid);
    int itemType = isOfflinePage ? DownloadSharedPreferenceEntry.ITEM_TYPE_OFFLINE_PAGE
                                 : DownloadSharedPreferenceEntry.ITEM_TYPE_DOWNLOAD;
    addOrReplaceSharedPreferenceEntry(new DownloadSharedPreferenceEntry(notificationId,
            isOffTheRecord, canDownloadWhileMetered, downloadGuid, fileName, itemType));
    if (startTime > 0) builder.setWhen(startTime);
    Intent cancelIntent = buildActionIntent(
            ACTION_DOWNLOAD_CANCEL, notificationId, downloadGuid, fileName, isOfflinePage);
    builder.addAction(R.drawable.btn_close_white,
            mContext.getResources().getString(R.string.download_notification_cancel_button),
            buildPendingIntent(cancelIntent, notificationId));
    Intent pauseIntent = buildActionIntent(
            ACTION_DOWNLOAD_PAUSE, notificationId, downloadGuid, fileName, isOfflinePage);
    builder.addAction(R.drawable.ic_media_control_pause,
            mContext.getResources().getString(R.string.download_notification_pause_button),
            buildPendingIntent(pauseIntent, notificationId));
    updateNotification(notificationId, builder.build());
    if (!mDownloadsInProgress.contains(downloadGuid)) {
        mDownloadsInProgress.add(downloadGuid);
    }
}
 
Example 17
Project: android-WearAccessibilityApp   File: GlobalNotificationBuilder.java   View Source Code Vote up 4 votes
public static NotificationCompat.Builder getNotificationCompatBuilderInstance() {
    return sGlobalNotificationCompatBuilder;
}
 
Example 18
Project: MKAPP   File: ServiceSinkhole.java   View Source Code Vote up 4 votes
private Notification getEnforcingNotification(int allowed, int blocked, int hosts) {
    Intent main = new Intent(this, ActivityMain.class);
    PendingIntent pi = PendingIntent.getActivity(this, 0, main, PendingIntent.FLAG_UPDATE_CURRENT);

    TypedValue tv = new TypedValue();
    getTheme().resolveAttribute(R.attr.colorPrimary, tv, true);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
            .setSmallIcon(isLockedDown(last_metered) ? R.drawable.ic_lock_outline_white_24dp : R.drawable.ic_security_white_24dp)
            .setContentIntent(pi)
            .setColor(tv.data)
            .setOngoing(true)
            .setAutoCancel(false);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
        builder.setContentTitle(getString(R.string.msg_started));
    else
        builder.setContentTitle(getString(R.string.app_name))
                .setContentText(getString(R.string.msg_started));

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        builder.setCategory(Notification.CATEGORY_STATUS)
                .setVisibility(Notification.VISIBILITY_SECRET)
                .setPriority(Notification.PRIORITY_MIN);
    }

    if (allowed > 0 || blocked > 0 || hosts > 0) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            if (Util.isPlayStoreInstall(this))
                builder.setContentText(getString(R.string.msg_packages, allowed, blocked));
            else
                builder.setContentText(getString(R.string.msg_hosts, allowed, blocked, hosts));
            return builder.build();
        } else {
            NotificationCompat.BigTextStyle notification = new NotificationCompat.BigTextStyle(builder);
            notification.bigText(getString(R.string.msg_started));
            if (Util.isPlayStoreInstall(this))
                notification.setSummaryText(getString(R.string.msg_packages, allowed, blocked));
            else
                notification.setSummaryText(getString(R.string.msg_hosts, allowed, blocked, hosts));
            return notification.build();
        }
    } else
        return builder.build();
}
 
Example 19
Project: q-mail   File: NotificationController.java   View Source Code Vote up 4 votes
NotificationCompat.Builder createNotificationBuilder() {
    return new NotificationCompat.Builder(context);
}
 
Example 20
Project: Clipcon-AndroidClient   File: TransparentActivity.java   View Source Code Vote up 4 votes
public void showUploadProgressNoti() {
    final int id = 1;
    final NotificationManager mNotifyManager =
            (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
    final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext());

    mBuilder.setContentTitle("Data Upload")
            .setContentText("Upload in progress")
            .setSmallIcon(R.drawable.icon_logo)
            .setProgress(0, 0, true);

    mNotifyManager.notify(id, mBuilder.build());

    RetrofitUploadData.UploadCallback uploadCallback = new RetrofitUploadData.UploadCallback() {
        @Override
        public void onUpload(long onGoing, long fileLength, double progressValue) {
            double onGoingMB = ((onGoing / 1024.0) / 1024.0);
            double fileLengthMB = ((fileLength / 1024.0) / 1024.0);

            DecimalFormat dec = new DecimalFormat("0.0");

            String progress = (int) progressValue + "% (" + dec.format(onGoingMB) + " / " + dec.format(fileLengthMB) + " MB)";

            mBuilder.setProgress(100, (int)progressValue, false);
            mBuilder.setContentText("Uploading...  " + progress);
            mBuilder.setAutoCancel(true);

            mNotifyManager.notify(id, mBuilder.build());
        }
        @Override
        public void onComplete() {
            Intent intent = new Intent(getApplicationContext(), GroupActivity.class);
            intent.putExtra("History", "test");
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);

            PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
            mBuilder.setProgress(100, 100, false);
            mBuilder.setContentText("Upload complete");
            mBuilder.setAutoCancel(true);
            mBuilder.setContentIntent(pendingIntent);

            mNotifyManager.notify(id, mBuilder.build());
        }
    };

    Endpoint.getUploader().setUploadCallback(uploadCallback);
}