本文整理汇总了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);
}