Android Open Source - cpustats Boot Receiver






From Project

Back to project page cpustats.

License

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.

Java Source Code

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);
            }
        }
        
    }
}




Java Source Code List

jp.takke.cpustats.BootReceiver.java
jp.takke.cpustats.C.java
jp.takke.cpustats.ConfigActivity.java
jp.takke.cpustats.MyAsyncTask.java
jp.takke.cpustats.MyLog.java
jp.takke.cpustats.MyUtil.java
jp.takke.cpustats.PreviewActivity.java
jp.takke.cpustats.QuadResourceUtil.java
jp.takke.cpustats.QuadResourceUtil.java
jp.takke.cpustats.ResourceUtil.java
jp.takke.cpustats.UsageUpdateService.java