本文整理匯總了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;
}
示例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);
}
示例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);
}
示例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);
}