Android Open Source - CakeUI Cake Broadcast Receiver






From Project

Back to project page CakeUI.

License

The source code is released under:

GNU General Public License

If you think the Android project CakeUI 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.cakeui.utils;
//from   w  w w  .  ja v  a  2 s  .  co m
import com.cakeui.generic.activity.CakeActivity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * 
 * @author Sarah Caixeta
 * @email caixeta.sarah@gmail.com
 * 
 *  Class that implements a BroadcastReceiver to exchange data between different application components.
 *
 */
public class CakeBroadcastReceiver extends BroadcastReceiver{

  public static final String CAKE_BROADCAST = "com.cakeui.broadcast.receiver";
  public static final String CAKE_BROADCAST_DATA = "cakeui.broadcast.receiver.data";
  
  private CakeActivity activity;
  
  public CakeBroadcastReceiver (CakeActivity activity){
    this.activity = activity;
  }
  
  @Override
  public void onReceive(Context context, Intent dataIntent) {

    if (dataIntent != null && dataIntent.hasExtra(CAKE_BROADCAST_DATA)){
      
      CakeDataEncapsulation cakeDataEncapsulation = (CakeDataEncapsulation) dataIntent.
          getSerializableExtra(CAKE_BROADCAST_DATA);
      activity.handleDataFromBroadcast(cakeDataEncapsulation);
    }
    
  }

}




Java Source Code List

com.cakeui.application.CakeApplication.java
com.cakeui.generic.activity.CakeActivity.java
com.cakeui.generic.adapter.CakeExpandableListViewAdapter.java
com.cakeui.generic.adapter.CakeGridViewAdapter.java
com.cakeui.generic.adapter.CakeListViewAdapter.java
com.cakeui.generic.dialog.CakeDialog.java
com.cakeui.generic.fragment.CakeFragment.java
com.cakeui.generic.service.CakePeriodicService.java
com.cakeui.generic.service.CakeService.java
com.cakeui.utils.CakeAsyncTask.java
com.cakeui.utils.CakeBroadcastReceiver.java
com.cakeui.utils.CakeComparator.java
com.cakeui.utils.CakeDataEncapsulation.java
com.cakeui.utils.CakeMap.java
com.cakeui.utils.enums.AsyncTaskType.java
com.cakeui.utils.enums.DialogType.java
com.cakeui.utils.enums.PagesOpen.java