Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Completely Destroy App

 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys.

I am writing an Android application and i want to Completely destroy
when user return to Application it must start fresh copy.

So far, my application crash when user click to Back button and then click app icon and
app keep running in background when user click Home button.

I have searched over net and peoples says DON'T destroy app for free up memory.

Thanks for any help.
Regards
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to achieve by quitting the app? It is correct that the app lifecycle should generally be left alone, and managed by Android. (The crash should obviously be investigated and fixed.)
 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i want completely destroy application when user hit Back or Home button or any reason left the application.

When user back to application must start fresh copy of it Not resume.

Thanks for answer
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I wasn't clear in my question: why do you want to do this?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I concur with Ulf, trying to work around Android's life cycle to avoid a crash is the wrong way to go about it. If possible, it will take a lot of effort and will produce an app that doesn't perform the way it is expected (people generally expect to be able to use an app, switch to the phone or read a text message, then back again and continue where they left off). You should rather figure out what is causing the crash and fix that.
 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because, i want to close application and free up memory by myself. I don't want Android handle everything.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't fight the OS, it is written to take care of this.
 
ibrahim yener
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Don't fight the OS, it is written to take care of this.

I am not fighting with anything, cannot get what i want just annoying me.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes what you want to do is not what you should be doing anyway :-)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds a lot like the "back button" fiasco in web applications. People have problems in their app when the back button is used, so rather than fix the bugs, they try to disable the back button. Wrong approach.

Do you have a really good reason (a good reason) for trying to buck the system?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic