Android Open Source - LollipopDemo Data Layer Listener Service






From Project

Back to project page LollipopDemo.

License

The source code is released under:

Apache License

If you think the Android project LollipopDemo 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.ToxicBakery.lollipop;
//from  w  ww.  ja va2s . com
import android.content.Intent;

import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.WearableListenerService;

public class DataLayerListenerService extends WearableListenerService {

    private static final String START_ACTIVITY_PATH = "/start-wearableSyncActivity";

    @Override
    public void onMessageReceived(MessageEvent messageEvent) {

        // Check to see if the message is to start an activity
        if (messageEvent.getPath().equals(START_ACTIVITY_PATH)) {
            Intent startIntent = new Intent(this, DemoWearActivity.class);
            startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(startIntent);
        }
    }
}




Java Source Code List

com.ToxicBakery.lollipop.DataLayerListenerService.java
com.ToxicBakery.lollipop.DemoWearActivity.java
com.ToxicBakery.lollipop.MainActivity.java
com.ToxicBakery.lollipop.demo.CardViewActivity.java
com.ToxicBakery.lollipop.demo.NewActivityTransitionsActivity.java
com.ToxicBakery.lollipop.demo.RecyclerViewActivity.java
com.ToxicBakery.lollipop.demo.RevealActivity.java
com.ToxicBakery.lollipop.demo.RippleActivity.java
com.ToxicBakery.lollipop.demo.WearableNotificationsActivity.java
com.ToxicBakery.lollipop.demo.WearableSyncActivity.java
lollipop.toxicbakery.com.lollipopdemo.ApplicationTest.java