android.app.IntentService.onTaskRemoved()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(0.9k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中android.app.IntentService.onTaskRemoved()方法的一些代码示例,展示了IntentService.onTaskRemoved()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IntentService.onTaskRemoved()方法的具体详情如下:
包路径:android.app.IntentService
类名称:IntentService
方法名:onTaskRemoved

IntentService.onTaskRemoved介绍

暂无

代码示例

代码示例来源:origin: cemrich/zapp

@Override
public void onTaskRemoved(Intent rootIntent) {
  super.onTaskRemoved(rootIntent);
  onDestroy();
}

代码示例来源:origin: NordicSemiconductor/Android-DFU-Library

@Override
public void onTaskRemoved(final Intent rootIntent) {
  super.onTaskRemoved(rootIntent);
  // This method is called when user removed the app from Recents.
  // By default, the service will be killed and recreated immediately after that,
  // but we don't want it. User removed the task, so let's cancel DFU.
  final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  manager.cancel(NOTIFICATION_ID);
  stopSelf();
}

相关文章