监听BOOT_COMPLETED

1. AndroidManifest.xml 添加权限

 


2. 静态添加intent-filter


                
                  
            


3. 监听

public class ExternalReceiver extends BroadcastReceiver{

    @Override
    public void onReceive(Context context, Intent intent) {
			if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
			}
    }
}


你可能感兴趣的:(Android)