Android Open Source - FirePhoneDemos Widget Broadcast Receiver






From Project

Back to project page FirePhoneDemos.

License

The source code is released under:

Apache License

If you think the Android project FirePhoneDemos 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.zappos.firephone.receiver;
//from   ww  w  .j  a va2s .  c  o  m
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.amazon.device.home.HeroWidgetIntent;
import com.zappos.firephone.activity.HomeActivity;

/**
 * Broadcast receiver that listens for broadcasts sent by the launcher indicating
 * that an item in this application's app widget has been selected.
 */
public class WidgetBroadcastReceiver extends BroadcastReceiver {
    private static final String TAG = WidgetBroadcastReceiver.class.getSimpleName();

    // Called when the WidgetBroadcastReceiver receives an intent broadcast.
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.v(TAG, "Relieved a click from our home widget!");

        // Take action on this broadcast by launching HomeActivity.
        final Intent activityIntent = new Intent(context, HomeActivity.class);
        activityIntent.putExtra(HomeActivity.EXTRA_KEY, intent.getStringExtra(HeroWidgetIntent.EXTRA_HERO_WIDGET_DATA));
        activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(activityIntent);
    }
}




Java Source Code List

com.zappos.firephone.ApplicationTest.java
com.zappos.firephone.activity.BaseActivity.java
com.zappos.firephone.activity.GestureActivity.java
com.zappos.firephone.activity.HeadTrackingCircleActivity.java
com.zappos.firephone.activity.HomeActivity.java
com.zappos.firephone.activity.HomeWidgetActivity.java
com.zappos.firephone.activity.NumericBadgeActivity.java
com.zappos.firephone.firefly.FireFlyDigitalEntityUI.java
com.zappos.firephone.firefly.FireFlyPhoneActivity.java
com.zappos.firephone.firefly.FireFlyPlugin.java
com.zappos.firephone.firefly.FireFlyProductActivity.java
com.zappos.firephone.receiver.WidgetBroadcastReceiver.java
com.zappos.firephone.view.CircleView.java