package it.unitn.vanguard.reminiscence;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class RegistrationActivity extends Activity {

	private Button btnBack;
	private Button btnConfirm;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_registration);
		initializeButtons();
		initializeListeners();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.registration, menu);
        return true;
    }
    
    private void initializeButtons() {
    	btnBack = (Button) findViewById(R.id.registration_back_btn);
    	btnConfirm = (Button) findViewById(R.id.registration_confirm_btn);
	}
	
	private void initializeListeners() {
		btnConfirm.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO call previous activity
				Intent registrationIntent = new Intent(v.getContext(), DataNascitaActivity.class);
		        startActivityForResult(registrationIntent, 0);
			}
		});
		btnBack.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent loginIntent = new Intent(v.getContext(), LoginActivity.class);
		        startActivityForResult(loginIntent, 0);
			}
		});
	}
    
}

@@ -201,16 +201,48 @@
 .Button;
+%0Aimport android.widget.EditText;
 %0A%0Apublic
@@ -342,16 +342,115 @@
 onfirm;%0A
+%09private EditText editTextName;%0A%09private EditText editTextSurname;%0A%09private EditText editTextMail;%0A
 %09%0A    @O
@@ -1091,277 +1091,796 @@
 n);%0A
-%09%7D%0A%09%0A%09private void initializeListeners() %7B%0A%09%09btnConfirm.setOnClickListener(new View.OnClickListener() %7B%0A%09%09%09@Override%0A%09%09%09public void onClick(View v) %7B%0A%09%09%09%09// TODO call previous activity%0A%09%09%09%09Intent registrationIntent = new Intent(v.getContext(), DataNascitaActivity.class
+    %09editTextName = (EditText) findViewById(R.id.editTextregistrationName);%0A    %09editTextSurname = (EditText) findViewById(R.id.editTextregistrationSurname);%0A    %09editTextMail = (EditText) findViewById(R.id.editTextregistrationMail);%0A%09%7D%0A%09%0A%09private void initializeListeners() %7B%0A%09%09btnConfirm.setOnClickListener(new View.OnClickListener() %7B%0A%09%09%09@Override%0A%09%09%09public void onClick(View v) %7B%0A%09%09%09%09%0A%09%09%09%09String name = editTextName.getText().toString();%0A%09%09%09%09String surname = editTextSurname.getText().toString();%0A%09%09%09%09String mail = editTextMail.getText().toString();%0A%09%09%09%09%0A%09%09%09%09Intent registrationIntent = new Intent(v.getContext(), DataNascitaActivity.class);%0A%09%09%09%09registrationIntent.putExtra(%22name%22,name);%0A%09%09%09%09registrationIntent.putExtra(%22surname%22,surname);%0A%09%09%09%09registrationIntent.putExtra(%22email%22,mail
 );%0A%09

add intent parameters in RegistrationActivity