zoukankan      html  css  js  c++  java
  • app中使用

    KeepLive.startWork(this, KeepLive.RunMode.ROGUE, ForegroundNotification("Title", "message",
    R.mipmap.ic_launcher, object : ForegroundNotificationClickListener {
    override fun foregroundNotificationClick(context: Context, intent: Intent) {
    //点击通知回调

    }
    }), object : KeepLiveService {
    override fun onStop(http://www.amjmh.com/v/BIBRGZ_558768/) {
    //可能调用多次,跟onWorking匹配调用
    }

    override fun onWorking() {
    //一直存活,可能调用多次
    }
    })
    复制代码
    清单文件配置:

    <!--权限配置-->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.REORDER_TASKS" />

    <!--保活相关配置-->
    <receiver android:name="com.xiyang51.keeplive.receiver.NotificationClickReceiver" />
    <activity android:name="com.xiyang51.keeplive.activity.OnePixelActivity" />

    <service android:name="com.xiyang51.keeplive.service.LocalService" />
    <service android:name="com.xiyang51.keeplive.service.HideForegroundService" />
    <service
    android:name="com.xiyang51.keeplive.service.JobHandlerService"
    android:permission="android.permission.BIND_JOB_SERVICE" />
    <service
    android:name="com.xiyang51.keeplive.service.RemoteService"

  • 相关阅读:
    POJ 1300 Open Door
    POJ 2230 Watchcow
    codevs 1028 花店橱窗布置
    codevs 1021 玛丽卡
    codevs 1519 过路费
    codevs 3287 货车运输
    codevs 3305 水果姐逛水果街二
    codevs 1036 商务旅行
    codevs 4605 LCA
    POJ 1330 Nearest Common Ancestors
  • 原文地址:https://www.cnblogs.com/ly570/p/11291186.html
Copyright © 2011-2022 走看看