Android Open Source - Static-IP-Switcher Receiver






From Project

Back to project page Static-IP-Switcher.

License

The source code is released under:

Apache License

If you think the Android project Static-IP-Switcher 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.htbest2000.staticipswitcher2;
//from  w w  w  . j a v  a 2 s. c  o  m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;

public class Receiver extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
      // write prefs to "just_boot=true"
      SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
      sp.edit().putBoolean("just_boot", true).commit();
      Log.i("=ht=", "I got BOOT COMPLETE");
    }

  }

}




Java Source Code List

com.htbest2000.staticipswitcher2.ConfigActivity.java
com.htbest2000.staticipswitcher2.Receiver.java
com.htbest2000.staticipswitcher2.StaticIpSwitcherAppWidgetProvider.java
com.htbest2000.staticipswitcher2.Utils.java