Package fire.eagle.android

Source Code of fire.eagle.android.IntentReceiver

package fire.eagle.android;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class IntentReceiver extends BroadcastReceiver
{
  public IntentReceiver()
  {
    super();
  }

  @Override
  public void onReceive(Context ctx, Intent intent)
  {
    String action = intent.getAction();
   
    Log.i("Fire Eagle", "IntentReceiver action = " + action);
   
    if (Intent.ACTION_BOOT_COMPLETED.equals(action))
    {
      onBootCompleted(ctx, intent);
    }
   
  }

  protected void onBootCompleted(Context ctx, Intent intent)
  {
    if (Preferences.getUserSpecificAccessToken().isValid())
    {
      Log.i("Fire Eagle", "about to start background service");

      ComponentName result = ctx.startService(BackgroundService.getIntent(ctx));
     
      if (result == null)
      {
        Log.e("Fire Eagle", "unable to start background service");
      }
    }
   
  }
 
}
TOP

Related Classes of fire.eagle.android.IntentReceiver

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.