Pregunta

I have 4 activities, A B C D A is Menu and it's contained from 3 buttons that start other 3 activities, B C D. What I want, I want when I start B C D activity and decide to go to menu, to show Menu. It's working but there is a problem. Always when I go back to Menu, there is a Copy of Menu Activity. So how can I set it to resume activity not create new one? But Without destroying it.

¿Fue útil?

Solución

Without any code, its a little unclear what your problem is but I think what you want is to set an Intent.Flag. When starting the Activity add this flag to your Intent

Intent i = new Intent(CurrentActivityName.this, MenuActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);  // set the flag
startActivity(i);[

and don't call finish() in your menu Activity.

Intent Docs

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top