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);
            }
     
        }
     
    }
  • 相关阅读:
    WinForm中快捷键与组合按键的设置方法
    WinForm窗体间传值的方法
    System.Data.SqlClient 命名空间
    登录
    查找和替换
    进制转换
    对话框
    Object基类
    抽象类与抽象方法
    千位数减百位数不退位 区间代换
  • 原文地址:https://www.cnblogs.com/lzh-Linux/p/4457151.html
Copyright © 2011-2022 走看看