Android开发之静态注册实现开机启动
来源:互联网 发布:indexof数组 编辑:程序博客网 时间:2024/05/12 07:44
在上一篇动态监听的继承上继续写
新建一个BootCompleteReceiver继承自BroadcastReceiver
package com.example.broadcasttest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
public class BootCompleteReceiver extends BroadcastReceiver{
public void onReceive(Context context,Intent intent){
Toast.makeText(context, "Boot Complete", Toast.LENGTH_LONG).show();
}
}
在AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.broadcasttest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.broadcasttest.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".BootCompleteReceiver">
<intent-filter >
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
</application>
</manifest>
- Android开发之静态注册实现开机启动
- Android之广播二(静态注册实现开机启动)
- 静态注册实现开机启动
- 静态注册实现开机启动
- 【Android】安卓学习笔记之广播(二)静态注册实现开机启动
- android广播:静态注册实现开机启动(第一行代码android学习)
- Android开发之实现应用程序的开机自启动
- Android开发之使用BroadcastReceiver实现开机自动启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发:系统自动实现开机启动
- Android开发 之 开机自动启动
- Android Ndk开发入门(实现静态注册,动态注册)
- CentOS系统时间与网络同步
- ListView滑动删除 ,仿腾讯QQ
- MSSQL 查看表结构
- OkHttp的深入研究:Jesse Wilson(三)
- 第4章 Android IDA pro使用
- Android开发之静态注册实现开机启动
- 怎样删除svn的项目
- Nim网络编程
- PHP中file_exists与is_file,is_dir的区别介绍
- JavaWeb开发_html点击图片某区域进行操作
- const
- android如何调用@hide和internal API
- php中mkdir()函数的权限问题
- Chrome 最小字体12px