package edu.umt.csci427.canary;

import android.app.Activity;
import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.TextView;

/**
 * Created by Rye on 4/2/2015.
 *
 * Extends the BroadcastReceiver abstract class. Receives the intents sent out by OpenICE.java
 * These intents contain the medical data (simplified until abstract factory in place).
 */

public class OpenICEIntentReceiver extends BroadcastReceiver {

    private String METRIC_ID;
    private TextView dataView;
    private Fragment MonitorFrag;

<<<<<<< HEAD
=======
    public OpenICEIntentReceiver() {
        throw new UnsupportedOperationException("Do not call empty constructor!");
    }

    public OpenICEIntentReceiver(Activity mainActivity, TextView tv){
        if(mainActivity != null) this.MainActivity = mainActivity;
        if(tv != null) this.dataView = tv;
    }

>>>>>>> 3e0dfcf324781924525822900d49f3204b4a0412
    public OpenICEIntentReceiver(Fragment monitorFragment, TextView tv){
        if(monitorFragment != null) this.MonitorFrag = monitorFragment;
        if(tv != null) this.dataView = tv;
    }

    @Override
    public void onReceive(Context context, Intent intent) {

        Double data = intent.getDoubleExtra(OpenICE.METRIC_VALUE, -1);
        dataView.setText(Double.toString(data));
    }
}

@@ -612,29 +612,8 @@
 g;%0A%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A=======%0A
     
@@ -739,244 +739,8 @@
  %7D%0A%0A
-    public OpenICEIntentReceiver(Activity mainActivity, TextView tv)%7B%0A        if(mainActivity != null) this.MainActivity = mainActivity;%0A        if(tv != null) this.dataView = tv;%0A    %7D%0A%0A%3E%3E%3E%3E%3E%3E%3E 3e0dfcf324781924525822900d49f3204b4a0412%0A
     

remove invalid constructor form OpenICEIntentReceiver