zoukankan      html  css  js  c++  java
  • android开机自启动广播

    权限<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

        <span style="color: #ff00ff;"><receiver android:name=".BootBroadcastReceiver">
            <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <category android:name="android.intent.category.HOME" />
            </intent-filter>
        </receiver>
     
     
    public class BootBroadcastReceiver extends BroadcastReceiver {
        static final String action_boot="android.intent.action.BOOT_COMPLETED";
     
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals(action_boot)){
                Intent ootStartIntent=new Intent(context,BootStartDemo.class);
                ootStartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(ootStartIntent);
            }
     
        }
     
    }
  • 相关阅读:
    linux_进程管理
    Linux-日志管理
    Httpd
    Linux-源码安装包管理
    Linux-计划任务管理
    Linux-LVM管理
    Linux-系统磁盘管理
    Linux-yum工具的使用
    Linux-rpm包管理
    Linux-网络进阶管理
  • 原文地址:https://www.cnblogs.com/lzh-Linux/p/4457151.html
Copyright © 2011-2022 走看看