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"

  • 相关阅读:
    HDU
    HDU
    A. Reorder the Array
    A. New Building for SIS Codeforce
    HUD Is It A Tree?!!!!!)
    博客园申请博客批准
    一起学CC3200之CRC校验
    新安装CCS 编译问题Process_begin :createProcess
    一起学CC3200之开发环境简介(2)烧录程序
    新安装CCS 后编译出现问题:gmake:No rule to make target clean
  • 原文地址:https://www.cnblogs.com/ly570/p/11291186.html
Copyright © 2011-2022 走看看