當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationManagerCompat.cancel方法代碼示例

本文整理匯總了Java中android.support.v4.app.NotificationManagerCompat.cancel方法的典型用法代碼示例。如果您正苦於以下問題:Java NotificationManagerCompat.cancel方法的具體用法?Java NotificationManagerCompat.cancel怎麽用?Java NotificationManagerCompat.cancel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.app.NotificationManagerCompat的用法示例。


在下文中一共展示了NotificationManagerCompat.cancel方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearNotification

import android.support.v4.app.NotificationManagerCompat; //導入方法依賴的package包/類
private void clearNotification() {
    if (mMediaNotificationInfo == null) return;

    NotificationManagerCompat manager = NotificationManagerCompat.from(mContext);
    manager.cancel(mMediaNotificationInfo.id);

    if (mMediaSession != null) {
        mMediaSession.setCallback(null);
        mMediaSession.setActive(false);
        mMediaSession.release();
        mMediaSession = null;
    }
    mContext.stopService(createIntent(mContext));
    mMediaNotificationInfo = null;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:16,代碼來源:MediaNotificationManager.java

示例2: handleHideHomework

import android.support.v4.app.NotificationManagerCompat; //導入方法依賴的package包/類
/**
 * Handle action to hide homework notification in the provided background thread
 */
private void handleHideHomework() {
    Log.d(TAG, "Hiding homework notification");
    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
    notificationManager.cancel("homework", 1);
}
 
開發者ID:gregoreesmaa,項目名稱:minu-poska-android,代碼行數:9,代碼來源:NotificationService.java

示例3: handleHideLesson

import android.support.v4.app.NotificationManagerCompat; //導入方法依賴的package包/類
/**
 * Handle action to hide lesson notification in the provided background thread
 */
private void handleHideLesson() {
    Log.d(TAG, "Hiding lesson notification");
    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
    notificationManager.cancel("lesson", 0);
}
 
開發者ID:gregoreesmaa,項目名稱:minu-poska-android,代碼行數:9,代碼來源:NotificationService.java

示例4: cancell

import android.support.v4.app.NotificationManagerCompat; //導入方法依賴的package包/類
public static void cancell(Context context, int id) {
    NotificationManagerCompat nm = NotificationManagerCompat.from(context);
    nm.cancel(id);
}
 
開發者ID:InnoFang,項目名稱:FamilyBond,代碼行數:5,代碼來源:NotificationUtil.java


注:本文中的android.support.v4.app.NotificationManagerCompat.cancel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。