Hola fchirico:
Cuando cambias de actividad, no debes quitar todas las vistas (Activity.RemoveAllViews), si no, cuando vuelvas a la primera actividad al pulsar el botón atrás, tu actividad estará vacía y tendrías que volver a cargar tu layout.
Tampoco es necesario hacer un ACTIVITY.FINISH al salir de una actividad.
vuelvo a la ACTIVIDAD2, esta no toma en el ACTIVITY_CREATE como FIRSTIME
Esto es lógico, ya que no es la primera vez que se ejecuta esa actividad, ya se ejecutó antes.
si el usuario VUELVE A INICIAR SESION
¿Con qué código vuelve a iniciar sesión? Puedes hacer que cuando cambie de sesión, se vuelvan a actualizar los datos que necesites.
Te recomiendo que le eches un vistazo a estos tres tutoriales.
- El primero muestra distintas formas de mostrar 2 "pantallas diferentes", ya sean como actividades distintas, o como dos paneles en la misma actividad. (Ten en cuenta que muchas veces no es necesario cambiar de actividad si es un código sencillo para mostrar un panel con datos o algo así:
As an answer to the thread Forms alike, I thought that the examples below would be of general interest. Attached there are 4 examples with two same layouts but with different managements: - TwoPanelActivity One Activity with 1 Layout with 2 Panels and all views on the panels. All the code is...
- El segundo es el ciclo de vida de una app android, ahí verás cuándo se ejecuta cada sub (create, resume, pause...) de una actividad:
Hi all... I'm posting this in the hopes that it'll help anyone programming with B4A to understand the life cycle of an activity. I struggled with this a bit, and the graphical representation made it easier for me to understand. I hope it helps some of you. (Thanks to Erel for proofing it for...
- El tercero es sobre CallSubDelayed, con esta sub, puedes llamar a una sub en otra actividad, y pasarle como parámetro lo que quieras (por ej. al cambiar de inicio de sesión, puedes llamar a la función de la actividad 2 para que actualice los datos:
Until Basic4android v2.00 the way to pass information between activities and services was through process global variables. CallSubDelayed makes it much simpler. It allows you to call a sub in a different service or activity. If the target module is not active, then it will be started...