package org.adaptlab.chpir.android.survey.Receivers;

import org.adaptlab.chpir.android.survey.SurveyActivity;
import org.adaptlab.chpir.android.survey.SurveyFragment;

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

public class SurveyLaunchReceiver extends BroadcastReceiver {
    private static final String TAG = "SurveyLaunchReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        Long instrumentId = intent.getLongExtra(SurveyFragment.EXTRA_INSTRUMENT_ID, -1);
        Log.i(TAG, "Received broadcast to launch survey for instrument with remote id " + instrumentId);
        Intent i = new Intent(context, SurveyActivity.class);
        i.putExtra(SurveyFragment.EXTRA_INSTRUMENT_ID, instrumentId);
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i);
    }
}
@@ -678,32 +678,69 @@
  instrumentId);%0A
+        if (instrumentId %3E -1) %7B%0A    
         Intent i
@@ -785,16 +785,20 @@
 class);%0A
+    
         
@@ -851,32 +851,36 @@
  instrumentId);%0A
+    
         i.setFla
@@ -922,16 +922,20 @@
         
+    
 context.
@@ -952,15 +952,25 @@
 ity(i);%0A
+        %7D%0A
     %7D%0A%7D

Fix instrument does not exist for id bug in survey launch receiver