Android Open Source - Valybe Charge Receiver






From Project

Back to project page Valybe.

License

The source code is released under:

Apache License

If you think the Android project Valybe 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 com.lybe;
/*from www.ja va 2 s.  c om*/
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ChargeReceiver extends BroadcastReceiver {

  private boolean chargeMark;
    @Override
    public void onReceive(Context context, Intent intent) {
    chargeMark = context.getSharedPreferences("delay",Activity.MODE_PRIVATE)
        .getBoolean("chargeMark", true);
        if(intent.getAction().equals(Intent.ACTION_POWER_CONNECTED) && chargeMark){
          Intent bootActivityIntent=new Intent(context,PreActivity.class);
          bootActivityIntent.putExtra("chargeMark", true);
            bootActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(bootActivityIntent);
        }
    }
}




Java Source Code List

com.lybe.BaseActivity.java
com.lybe.BootReceiver.java
com.lybe.ChargeReceiver.java
com.lybe.HelpActivity.java
com.lybe.OneActivity.java
com.lybe.OtherActivity.java
com.lybe.PreActivity.java
com.lybe.SettingActivity.java