Back to project page resident-background-service.
The source code is released under:
MIT License
If you think the Android project resident-background-service listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright (c) 2015 Yu AOKI//from ww w . j av a2s . com * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ package com.aokyu.service.receiver; import com.aokyu.service.ResidentService; import com.aokyu.service.setting.Settings; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class PackageReplacedReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent == null) { return; } Settings settings = Settings.getInstance(context); String action = intent.getAction(); if (Intent.ACTION_MY_PACKAGE_REPLACED.equals(action) && settings.isServiceEnabled()) { ResidentService.start(context); } } }