I have as a small project to create an array of Name, Surname and Email which I have created using xml in the value
This is my xml named Name with a String named names
<resources>
<string name="names">
<item>Ivan</item>
<item>Santiago</item>
.....
</string>
</resources>
This is my XML named Surnames with a String called surnames
<resources>
<string name="surnames">
<item>Rodríguez</item>
<item>Gómez</item>
<item>López</item>
.....
</string>
</resources>
public class Registro extends AppCompatActivity implements View.OnClickListener {
private TextView Nombre,Apellido,Correo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registro);
//Seteamos las Cajas de Texto
Nombre = (TextView) findViewById(R.id.txtNombre);
Apellido = (TextView) findViewById(R.id.txtApellido);
Correo = (TextView) findViewById(R.id.txtCorreo);
//Ponemos en Modo de Escucha al Boton
findViewById(R.id.btnGenerar).setOnClickListener(this);
}
@Override
public void onClick(View v) {
}
}
I want to randomly select names from the XML arrays and display them in a text view.

<string name="nomes">