Back to project page cpustats.
The source code is released under:
Apache License
If you think the Android project cpustats listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package jp.takke.cpustats; //from w ww. j a va 2s . c om import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { MyLog.i("BootReceiver.onReceive"); if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { // ???????????? // ?????????? final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context); final boolean startOnBoot = pref.getBoolean(C.PREF_KEY_START_ON_BOOT, false); MyLog.i("start on boot[" + (startOnBoot ? "YES" : "NO") + "]"); if (startOnBoot) { // ?????? final Intent serviceIntent = new Intent(context, UsageUpdateService.class); context.startService(serviceIntent); } } } }