Activity enters onPause only the first time it is called

Asked

Viewed 41 times

0

I’ve got a Pedidocad Activity calling a Productocons, following code to open Productocons:

Intent intent = new Intent(PedidoCadActivity.this, ProdutoConsActivity.class);
 intent.putExtra("activity", "pedidoCad");
 startActivityForResult(intent, 2);

When I choose the item I want in Activity Productocons, I click on the button that executes this code:

setTotalItem();
setObjPedidoItens();
setDescPorcentagem();
setDescValor();
Bundle bundle = new Bundle();
bundle.putParcelable("objPedidoItem", objPedidoItem);
Intent i = new Intent();
i.putExtras(bundle);
setResult(1, i);
finish();

The problem is that when finishing Productocons for the second time to add the second product, it does not fall into onResume, it goes to onCreate, and the Listview that is added the items is restarted every time do not know why.

  • someone can give me this help?

  • This happens in your Activity Pedidocad ?

  • Yes, when it comes back to Onactivityresult everything from Activity Pedidocad

  • Try to put the same context you used in Intent: Pedidocadactivity.this.startActivityForResult

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.