Back to project page RxWatchFace.
The source code is released under:
Apache License
If you think the Android project RxWatchFace listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.colintheshots.rxwatchface; //from w w w.ja v a 2 s . c o m import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable.WearableListenerService; /** * Created by colin.lee on 11/2/14. */ public class ListenerService extends WearableListenerService { private static final String TAG = "ListenerService"; public static final String MESSAGE_PATH = "/message"; @Override public void onMessageReceived(MessageEvent messageEvent) { if (messageEvent.getPath().equals(MESSAGE_PATH)) { final String message = new String(messageEvent.getData()); // Broadcast message to wearable activity for display Intent messageIntent = new Intent(); messageIntent.setAction(Intent.ACTION_SEND); messageIntent.putExtra("message", message); LocalBroadcastManager.getInstance(this).sendBroadcast(messageIntent); } else { super.onMessageReceived(messageEvent); } } }