I have a registration activity with 4 fields: 1 editText and 3 Spinners. At the click of a button the data filled in these fields are registered in the database and lead to another activity with an imageview of confirmation, which when passing 2 seconds returns to the activity of registration automatically.
In this case, I need it to inherit the fill that was before the click of the button, so the user does not have to type everything again and change only what he needs. How can I do this? Here's the click I need to call confirmation activity with imageView:
btn_Poliform.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
produto.setMatricula(Integer.parseInt(editText_matricula.getText().toString()));
produto.setSupervisao(spinner_supervisao.getSelectedItem().toString());
produto.setMaterial(spinner_material.getSelectedItem().toString());
produto.setQuantidade(Integer.parseInt(spinner_quantidade.getSelectedItem().toString()));
if(btn_Poliform.getText().toString().equals("REGISTRAR AGORA")){
bdHelper.salvarProduto(produto);
bdHelper.close();
}
}
});
Here is the confirmation activity with the time of 2 seconds:
public class Finalizando extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_finalizando);
final int MILISEGUNDOS = 2000;
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
Intent intent = new Intent(Finalizando.this, RegistrosMateriais.class);
Finalizando.this.startActivity(intent);
}
}, MILISEGUNDOS);
}