0
I have an Activity of registration with 4 fields: 1 editText and 3 Spinners. At the click of a button the data entered in these fields are recorded in the database and lead to another Activity with a confirmation imageView, which when passing 2 seconds back to the registration Activity automatically.
In this case, I need it to come back by inheriting the fill that was before the click of the button, so that the user does not need to type everything again and change only what he needs. How can I do that? 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);
}
Because you have made another Activity only to show the finishing screen, and you could do a Dialogfragment in the same acitivity and still control everything locally in Activity, it makes no sense to go out creating Activity without having a specific activity for it
– Weslley Barbosa
You’re right but I don’t know how to do a Dialogfragment, I didn’t even know there was KKK, can you help me? I need a very large confirmation for the user to understand that it was really saved, understand why I chose an imageView separates soon..
– Diego Mota Christ
I will post the answer you need to make a dialog full screen that looks like an Activity
– Weslley Barbosa