package com.barvoy.sensorama;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import com.barvoy.sensorama.Sensorama;
import com.barvoy.sensorama.SRDataPoint;

public class MainActivity extends ActionBarActivity {

    public Sensorama S;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        S = new Sensorama();
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public void recordingStartEnd(View view) {
        // Do something in response to button
        System.out.println("recordingStartEnd");
        SRDataPoint point = new SRDataPoint("sample");
        S.addPoint(point);
    }

    public void recordingShare(View view) {
        // Do something in response to button
        System.out.println("recordingShare");
        S.dumpPoints();
    }
}

@@ -211,16 +211,46 @@
 ew.View;
+%0Aimport android.widget.Button;
 %0A%0Aimport
@@ -1439,48 +1439,356 @@
     
-System.out.println(%22recordingStartEnd%22);
+Button buttonStartEnd = (Button) findViewById(view.getId());%0A%0A        String textCurrent = buttonStartEnd.getText().toString();%0A%0A        String textStart = %22Start recording%22;%0A        if (textCurrent.equals(textStart)) %7B%0A            buttonStartEnd.setText(%22Stop recording%22);%0A        %7D else %7B%0A            buttonStartEnd.setText(textStart);%0A        %7D%0A
 %0A   

Add turning on and off.