You are on page 1of 20

.XML

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/ivFondo1"
android:src="@drawable/fondo1"
android:scaleType="centerCrop"
android:onClick="muestraImagen"/>

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/ivFondo2"
android:src="@drawable/fondo2"
android:scaleType="centerCrop"
android:onClick="muestraImagen"/>
</FrameLayout>

.java

package com.miexamen.appframelayout;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

ImageView ivFondo1,ivFondo2;

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

ivFondo1 = (ImageView) findViewById(R.id.ivFondo1);
ivFondo2 = (ImageView) findViewById(R.id.ivFondo2);
}

public void muestraImagen(View view){
if(view.getId() == R.id.ivFondo1){
ivFondo1.setVisibility(View.GONE);
ivFondo2.setVisibility(View.VISIBLE);
}else{
ivFondo2.setVisibility(View.GONE);
ivFondo1.setVisibility(View.VISIBLE);
}
}
}
.XML

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<ImageView android:id="@+id/imageView"
android:layout_column="1"
android:layout_width="350dp"
android:layout_height="80dp"
android:src="@drawable/fondo1"
android:layout_span="2"/>

</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<ImageView android:id="@+id/imageView2"
android:layout_column="1"
android:layout_height="80dp"
android:layout_width="350dp"
android:src="@drawable/fondo2"
android:layout_span="2"/>

</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="BOLETA DE APGO JUNIO 2018"
android:id="@+id/tvTitulo"
android:layout_column="1"
android:layout_span="3"
android:layout_marginBottom="5dp"
android:layout_gravity="center"
android:textColor="@color/abc_search_url_text_pressed"/>
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="COSTO AHORA"
android:id="@+id/tvCosto"
android:layout_column="1"
android:textColor="@color/abc_search_url_text_pressed"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/tvCostoHora"
android:layout_column="2"/>

</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="HORAS TRABAJADAS"
android:id="@+id/tvHoras"
android:layout_column="1"
android:textColor="@color/abc_search_url_text_pressed"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/tvHorasTrabajadas"
android:layout_column="2"/>

</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView3"
android:layout_column="1"
android:src="@drawable/fondo3"
android:layout_span="2"/>
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="SALARIO"
android:id="@+id/tvSalario"
android:layout_column="1"
android:textColor="@color/abc_search_url_text_pressed"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/tvMontoSalario"
android:layout_column="2"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="DESCUENTO"
android:id="@+id/tvDescuento"
android:layout_column="1"
android:textColor="@color/abc_search_url_text_pressed"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/tvMontoDescuento"
android:layout_column="2"/>/>
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">

<TextView
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="NETO"
android:id="@+id/tvNeto"
android:layout_column="1"
android:textColor="@color/abc_search_url_text_pressed"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:id="@+id/tvMontoNeto"
android:layout_column="2"/>/>
</TableRow>
</TableLayout>

.JAVA

package com.miexamen.apptienda;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

TextView tvCosto,tvHoras;
TextView tvSalario,tvDescuento,tvNeto;

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

tvCosto = (TextView)findViewById(R.id.tvCostoHora);
tvHoras = (TextView)findViewById(R.id.tvHorasTrabajadas);
tvSalario = (TextView)findViewById(R.id.tvMontoSalario);
tvDescuento = (TextView)findViewById(R.id.tvMontoDescuento);
tvNeto = (TextView)findViewById(R.id.tvMontoNeto);

muestraBoleta();
}

public void muestraBoleta(){
double costo = 20;
int horas = 40;

double salario = costo*horas;
double descuento = salario*0.05;
double neto = salario-descuento;
tvCosto.setText("$"+String.format("%.2f",costo));
tvHoras.setText(String.valueOf(horas));

tvSalario.setText("$"+String.format("%.2f",salario));
tvDescuento.setText("$"+String.format("%.2f",descuento));
tvNeto.setText("$"+String.format("%.2f",neto));
}
}
.XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EDITORIAL"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView"
android:layout_marginTop="45dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="MACRO"
android:id="@+id/textView2"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:textColor="@color/abc_search_url_text_pressed"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="AUTOR: LIC.MANUEL TORRES.RE"
android:id="@+id/textView3"
android:layout_below="@+id/textView5"
android:layout_alignParentStart="true"
android:textColor="@color/abc_search_url_text_pressed" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="DESARROLLO DE APLICACIONES MÒVILES"
android:id="@+id/textView4"
android:layout_below="@+id/textView2"
android:layout_alignParentStart="true"
android:layout_marginTop="25dp"
android:textSize="28dp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="ANDROID"
android:id="@+id/textView5"
android:layout_below="@+id/textView4"
android:layout_alignParentStart="true"
android:textColor="@color/abc_search_url_text_pressed"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Android es considerado el sistema operativo mas vendido en el planeta"
android:id="@+id/textView6"
android:layout_below="@+id/textView3"
android:layout_marginTop="32dp"
android:textSize="16dp"/>

</RelativeLayout>

.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="11dp"
android:layout_marginTop="19dp"
android:text="PROMEDIO DE NOTAS"
android:textColor="@color/abc_input_method_navigation_guard"
android:textColorHighlight="#000000"
android:textSize="18dp" />

<EditText
android:id="@+id/etNota1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="36dp"
android:layout_marginTop="123dp"
android:ems="10"
android:inputType="number" />

<EditText
android:id="@+id/etAlumno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/etNota1"
android:layout_marginTop="56dp"
android:ems="10"
android:inputType="textPersonName" />

<EditText
android:id="@+id/etNota2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/etNota1"
android:layout_marginTop="195dp"
android:ems="10"
android:inputType="number" />

<EditText
android:id="@+id/etNota3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignStart="@+id/etNota1"
android:layout_marginBottom="195dp"
android:ems="10"
android:inputType="number" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/etAlumno"
android:layout_alignParentStart="true"
android:text="Alumno:" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/etNota1"
android:layout_alignStart="@+id/textView"
android:text="Nota 1:" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/etNota2"
android:layout_alignStart="@+id/textView"
android:text="Nota 2:" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/etNota3"
android:layout_alignParentStart="true"
android:text="Nota 3:" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="80dp"
android:text="ALUMNO" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="26dp"
android:text="PROMEDIO" />

<TextView
android:id="@+id/tvAlumno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="70dp"
android:text="xd" />

<TextView
android:id="@+id/tvPromedio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:text="dx" />

<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="118dp"
android:layout_marginStart="21dp"
android:onClick="calcularPromedio"
app:srcCompat="@android:drawable/ic_partial_secure"/>

</RelativeLayout>

.java

package com.miexamen.apppromedio;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

EditText etAlumno, etNota1, etNota2, etNota3;
TextView tvAlumno, tvPromedio;

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

etAlumno = (EditText)findViewById(R.id.etAlumno);
etNota1 = (EditText)findViewById(R.id.etNota1);
etNota2 = (EditText)findViewById(R.id.etNota2);
etNota3 = (EditText)findViewById(R.id.etNota3);

tvAlumno = (TextView)findViewById(R.id.tvAlumno);
tvPromedio = (TextView)findViewById(R.id.tvPromedio);
}

public void calcularPromedio(View view){
String alumno = etAlumno.getText().toString();
int nota1 = Integer.parseInt(etNota1.getText().toString());
int nota2 = Integer.parseInt(etNota2.getText().toString());
int nota3 = Integer.parseInt(etNota3.getText().toString());

double promedio = (nota1+nota2+nota3)/3.0;

tvAlumno.setText(alumno);
tvPromedio.setText(String.format("%.2f",promedio));
}
}
.XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1">

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/tvTitulo"
android:layout_column="1"
android:layout_span="2"
android:gravity="center"
android:text="REGISTRO PERSONAL"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="APELLIDOS"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />

<EditText
android:id="@+id/etApellidos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:ems="10"
android:inputType="textPersonName" />
</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="NOMBRES"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
<EditText
android:id="@+id/etNombres"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:ems="10"
android:inputType="textPersonName" />
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:id="@+id/textView3"
android:layout_column="1"
android:text="TELEFONO"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />

<EditText
android:id="@+id/etTelefono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:ems="10"
android:inputType="phone" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="EMAIL"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />

<EditText
android:id="@+id/etEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:ems="10"
android:inputType="textEmailAddress" />
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="FECHA NAC."
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />

<EditText
android:id="@+id/etFechaNac"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:ems="10"
android:inputType="date" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="REGISTRAR"
android:id="@+id/btnRegistrar"
android:layout_column="2"
android:background="@android:color/holo_blue_dark"
android:textColor="@color/abc_primary_text_material_dark"
android:onClick="muestraInformacion"
android:textSize="20dp"
tools:ignore="OnClick" />
</TableRow>
</TableLayout>

</LinearLayout>

.JAVA

package com.miexamen.appregistropersonal;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
EditText etApellidos, etNombres, etEmail, etTelefono, etFechaNac;

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

etApellidos = (EditText)findViewById(R.id.etApellidos);
etNombres = (EditText)findViewById(R.id.etNombres);
etEmail = (EditText)findViewById(R.id.etEmail);
etTelefono = (EditText)findViewById(R.id.etTelefono);
etFechaNac = (EditText)findViewById(R.id.etFechaNac);
}

public void muestraInformacion(View view){
Intent iInformacion = new Intent(MainActivity.this,Main2Activity.class);

iInformacion.putExtra("apellidos",etApellidos.getText().toString());
iInformacion.putExtra("nombres",etNombres.getText().toString());
iInformacion.putExtra("telefono",etTelefono.getText().toString());
iInformacion.putExtra("email",etEmail.getText().toString());
iInformacion.putExtra("fechaNac",etFechaNac.getText().toString());

startActivity(iInformacion);
}
}
.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Main2Activity">

<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1">

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView6"
android:layout_marginBottom="20dp"
android:layout_span="2"
android:gravity="center"
android:text="INFORMACION DE REGISTRO"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:text="APELLIDOS"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tvApellidos"
android:layout_column="1"
android:textColor="@color/abc_input_method_navigation_guard"/>
</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/textView9"
android:layout_column="1"
android:text="NOMBRES"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tvNombres"
android:layout_column="1"
android:textColor="@color/abc_input_method_navigation_guard"/>
</TableRow>

<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:id="@+id/textView11"
android:layout_column="1"
android:text="TELEFONO"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tvFono"
android:layout_column="1"
android:textColor="@color/abc_input_method_navigation_guard"/>
</TableRow>

<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView4"
android:layout_column="1"
android:text="CORREO ELECTRONICO"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tvCorreo"
android:layout_column="1"
android:textColor="@color/abc_input_method_navigation_guard"/>
</TableRow>
<TableRow
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:id="@+id/textView15"
android:layout_column="1"
android:text="FECHA NAC."
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/abc_input_method_navigation_guard" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/tvFechaNac"
android:layout_column="1"
android:textColor="@color/abc_input_method_navigation_guard"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">

<Button
android:id="@+id/btnSalir"
android:layout_width="match_parent"
android:onClick="salida"
android:layout_column="1"
android:text="SALIR"
tools:ignore="OnClick" />
</TableRow>
</TableLayout>

</RelativeLayout>

.java

package com.miexamen.appregistropersonal;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class Main2Activity extends AppCompatActivity {

TextView tvApellidos,tvNombres,tvTelefono,tvCorreo,tvFechaNac;

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

tvApellidos = (TextView)findViewById(R.id.tvApellidos);
tvNombres = (TextView)findViewById(R.id.tvNombres);
tvTelefono = (TextView)findViewById(R.id.tvFono);
tvCorreo = (TextView)findViewById(R.id.tvCorreo);
tvFechaNac = (TextView)findViewById(R.id.tvFechaNac);

muestraDatos();
}

public void muestraDatos(){

Bundle datos = getIntent().getExtras();
String apellidos = datos.getString("apellidos");
String nombres = datos.getString("nombres");
String telefono = datos.getString("telefono");
String correo = datos.getString("correo");
String fechaNac = datos.getString("fechaNac");
tvApellidos.setText(apellidos);
tvNombres.setText(nombres);
tvTelefono.setText(telefono);
tvCorreo.setText(correo);
tvFechaNac.setText(fechaNac);
}

public void salida(View view){
finish();
}
}