
package com.uwetrottmann.shopr.ui;

import android.app.Activity;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.EditText;

import com.uwetrottmann.shopr.R;
import com.uwetrottmann.shopr.settings.AppSettings;

public class TestSetupActivity extends Activity {

    private static final String TAG = "Test Setup";

    private EditText mNameEditText;
    private CheckBox mDiversityCheckBox;

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

        setupViews();
    }

    private void setupViews() {
        View startButton = findViewById(R.id.buttonTestSetupStart);
        startButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                onStartTest();
            }
        });

        mNameEditText = (EditText) findViewById(R.id.editTextTestSetupName);
        mDiversityCheckBox = (CheckBox) findViewById(R.id.checkBoxTestSetupDiversity);
    }

    protected void onStartTest() {
        // TODO Auto-generated method stub
        // record name, time and type (maybe create singleton to hold stuff)
        PreferenceManager.getDefaultSharedPreferences(this).edit()
                .putBoolean(AppSettings.KEY_USING_DIVERSITY, mDiversityCheckBox.isChecked())
                .commit();
        Log.d(TAG, "Setting diversity to : " + (mDiversityCheckBox.isChecked() ? "ON" : "OFF"));
    }

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

}

@@ -59,16 +59,47 @@
 tivity;%0A
+import android.content.Intent;%0A
 import a
@@ -1423,16 +1423,52 @@
 d stuff)
+%0A%0A        // set diversity on or off
 %0A       
@@ -1743,16 +1743,104 @@
 %22OFF%22));
+%0A%0A        // start the task%0A        startActivity(new Intent(this, MainActivity.class));
 %0A    %7D%0A%0A

Enable start button.