Shutting down, switching between, & more fun with activi

Put your problem here if it does not fit any of the other categories.

Shutting down, switching between, & more fun with activi

Postby Maoukiji » Wed Jul 01, 2009 1:04 am

First off I just wanted to say hi to everyone, I have been lurking these forums for a few days and found it to be pretty helpful, especially with finally getting a new activity to spawn correctly.

That aside, I need some help, with a few things actually - so I think I'll just list them in a list:
  • I have an activity created (Code below) on certain actions such as from a menu, or a button, and it works great... But I was wondering if there was a way to keep it in memory, but switch back to the parent, and then back again to the already spawned activity? I'd like to keep certain data from it in memory, and I've notice that unless the user closes the activity (Calc.this.finish();), they can keep spawning more and more activities, and when they finally DO close them, even though there are only two you can open, they end up with a lot of processes spawned.
  • Is there a good way to just completely exit from the entire application, regardless of how many activities have been spawned? Like I said above, I'm using Calc.this.finish(); to close the activity, but it has the aforementioned potential issue that I think may confuse some people. I want it so that even if they click "Exit" or "Close" in the menu from a child activity, it will still shut down the parent as well.

The code I'm using to spawn an activity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  2.         private void showCalc() {
  4.                 Intent i = new Intent(this, Calc.class);
  6.                 startActivityForResult(i, ACTIVITY_CREATE);
  8.         }
Parsed in 0.014 seconds, using GeSHi
Posts: 2
Joined: Wed Jul 01, 2009 12:54 am


Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 6 guests