Android Question Change activity without startactivity again

Discussion in 'Android Questions' started by Pilar-JLSineriz, Jun 25, 2015.

  1. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Hi.. I have an application with three activities, main, sc1 and sc2. I want to use a bottom to change between sc1 and main without to start activity "main" (similar to back action)

    Thanks
     
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    You want to use a bottom? I hope you mean button.

    If you do Activity.Finish it will go back to the previous activity (like back button).
     
    Peter Simpson and lemonisdead like this.
  3. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User


    sorry.... button!!!!!!!!

    Can I write Activity.finish in the button presents in activity sc1 and return to main???
     
  4. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Thanks thedesolatesoul.... it's perfect!!! ;)
     
  5. thedesolatesoul

    thedesolatesoul Expert Licensed User

    cool!
     
    lemonisdead likes this.
  6. qsrtech

    qsrtech Active Member Licensed User

    I would encourage you to move away from using multiple activities and switch to using "classes" see my post here http://www.b4x.com/android/forum/posts/342902/
    This avoids "switching" between activities and having to recreate activities and mess with saving "state".

    It also opens the door to using a drawer and a common toolbar with multiple "activities". Classes are also reusable so you could in effect have duplicate "activities" for example a web browser with multiple "tabs".

    Lastly, it will make your app more b4i friendly.

    Good luck!
     
  7. Pilar-JLSineriz

    Pilar-JLSineriz Active Member Licensed User

    Thanks thanks!!!!!!!
     
Loading...