android开发分享android开机自启动app示例分享

复制代码 代码如下:/*开机自动启动app*/public class bootreceiver extends broadcastreceiver { @overrid

复制代码 代码如下:
/*开机自动启动app*/
public class bootreceiver extends broadcastreceiver {

@override
public void onreceive(context context, intent intent) {

log.d(“xrgps”, “bootreceiver.onreceive: ” + intent.getaction());
if (action_boot_completed.equals(intent.getaction())) {
           intent mbootintent = new intent(context, mainactivity.class);
           mbootintent.setflags(intent.flag_activity_new_task);
           context.startactivity(mbootintent); 
    } else {
        log.w(“xrgps”, “bootreceiver: unsupported action”);
    }
}
}

上述就是android开发分享android开机自启动app示例分享的全部内容,如果对大家有所用处且需要了解更多关于Android学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/addevelopment/939986.html

(0)
上一篇 2021年11月13日
下一篇 2021年11月13日

精彩推荐