package com.example.android.wearable.watchface;

import android.app.PendingIntent;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
import android.util.Log;

import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.tagmanager.PreviewActivity;
import com.google.android.gms.wearable.MessageEvent;
import com.google.android.gms.wearable.Node;
import com.google.android.gms.wearable.Wearable;
import com.google.android.gms.wearable.WearableListenerService;


/**
 * Created by Dharam Maniar.
 * Activity is used to listen for questions and set alarms for each question based on the TimeToPrompt.
 */
public class ListenerService extends WearableListenerService {

    private static final String TAG = "ListenerService";

    private static final String START_ACTIVITY_PATH = "/fuzzytime";

    GoogleApiClient mGoogleApiClient;

    @Override
    public void onCreate() {
        super.onCreate();
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addApi(Wearable.API)
                .build();
        mGoogleApiClient.connect();
    }

    @Override
    public void onMessageReceived(MessageEvent messageEvent) {

        if (messageEvent.getPath().equals(START_ACTIVITY_PATH)) {

            String message = new String(messageEvent.getData());
            if (message.equals("NewLocation")) {
                Log.d(TAG, "Got message for New Location");
            }
        }
    }



    @Override
    public void onPeerConnected(Node peer) {

    }

    @Override
    public void onPeerDisconnected(Node peer) {

    }

}

@@ -61,162 +61,21 @@
 oid.
-app.PendingIntent;%0Aimport android.content.Intent;%0Aimport android.support.v4.app.NotificationCompat;%0Aimport android.support.v4.app.NotificationManagerCompa
+content.Inten
 t;%0Ai
@@ -161,66 +161,8 @@
 nt;%0A
-import com.google.android.gms.tagmanager.PreviewActivity;%0A
 impo
@@ -1305,26 +1305,228 @@
             
-%7D%0A
+    Intent promptIntent = new Intent(getApplicationContext(), PromptActivity.class);%0A                promptIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);%0A                startActivity(promptIntent);%0A    
         %7D%0A  
@@ -1527,18 +1527,27 @@
   %7D%0A    
+   
+ 
 %7D%0A
+    %7D
 %0A%0A%0A    @

Call the PromptActivity when user is at a new location