How to do housekeeping when an app closes

I am writing an app that needs to know when it has been closed so it can do some housekeeping. How do I know when a JFrame has been closed by the user?

LinuxMercedes wrote:
My apologies. I'm referring to the Runtime.addShutDownHook I noticed that the docs were for Java 6.When I post an API reference, I'm always copying it from another tab where I have the Java 6 doc open. That doesn't mean the reference only applies to java 6, however. Hopefully you, too, always keep a browser tab open to the API (If not, why not?). If you are developing in Java 5, then you must keep the API for Java 5 open. Is there any reason you haven't checked there? Also, new methods (almost always) end with the note (Since: 1.X). In this example, since 1.3.

Similar Messages

  • How can I check how many times or when an app has been re-downloaded on my iphone

    How can I check how many times or when an app has been re-downloaded on my iphone. I know how to check purchases but I am looking for how to check when an app had been re-downloaded on my device whether it's through my device or Apple ID

    You mention "lack of control" several times.  The control is there - you control the Apple ID and password that owns the app.  No other Apple ID can use the app.  You have not shared your Apple ID or password with anyone, so you and only you own the app.
    Therefore, the number of times the app is downloaded or re-downloaded is completely irrelevant.  You might, for example, decide to purchase a new iPhone or iPad and download the app there.  Or the app developer may issue a new version which you download.  None of this matters regarding your "control" of the app.  All that matters is that you own it and nobody else can use it.

  • How to reset sharedobject when an app is completely restarted?

    hi guys,
    i use sharedobject to save the previous state of the application, i.e. the last viewing screen.
    So for example, if the user clicked on an external link, he is being redirected to the safari browser, but when he click on my app on the "multi tasking panel" again, he is able to come back to the last viewed screen.
    But the problem is, i do not want the sharedobject to be stored for so long.
    Now, even if the user closed the application completely (i.e. by double clicking home button and terminate the application in the "multi tasking" panel), the sharedobject is still there.
    I want to discard the sharedobject values when the user completely closed the application. So that they have a chance to start the program flow from the beginning again.
    Anyone faced this problem before? Any trick to tackle this problem?
    Thanks in advanced.

    In the normal case, can you still use variables, or do you have to reinitialize all of those? If they are still around, then that might be a way to tell that the app was not force quit.
    Failing that, you could store the time in the shareobject, and just decide that if it's been a while since you wrote the data, then send them back to the main menu.
    In any case, making it easy to get to the main menu from anywhere would help solve the problem, because someone who did not force quit, who returns to your app, may well not want to be on that same page.

  • How do u complain when an app is rejected by App Store?

    is there an email address to grip that Apple won't allow Google Voice app onto iphone? My friend has it on Droid, very elegant; but iphone users must get around Apple's pettiness by using the Google Voice mobile site.
    Thanks
    bob

    In iPod Touch's Settings > Wi-Fi > toggle Wi-Fi Switch OFF then you'll know.

  • What do i do when my apps close on launch?

    I've had my iphone for two years, and evry once in awhile i have trouble with apps but this one has been ridiculous! My snapchat app keeps closing and i have no clue what to do! HELP! It's an iphone 4s.

    restart
    http://www.apple.com/support/iphone/assistant/phone/#section_1
    fixes 80% of people ills

  • Mail app closes when not used for a while how fix?

    mail app closes when not used for a while how fix?

    This may also be due to the Sudden Termination feature built into OS X, which will effectively quit a process if the system is demanding resources. Mail can be a RAM hog at times, and if your system only has a few GB of RAM, then when other programs demand more and you have not been using Mail then the system will invoke Sudden Termination to quit it so more RAM is available elsewhere.
    Do you have only ~2-4GB of RAM in your system? Check for this in the About This Mac option in the Apple menu, and if so then consider upgrading to more if your system supports it. Alternatively you can try quitting other applications to free up more RAM.
    To see which programs are using the most RAM, open the Activity Monitor utility and choose My Processes from the drop-down menu. Then ensure Real Memory is checked in the View > Columns menu, and click this menu's title to sort the items by it.
    Keep in mind that sudden termination does not fully quit the program, so Mail may still show up in Activity Monitor when you open it even though it may be closed from the Dock.

  • TS3274 my apps close on their own even when I am using them.How to fix?

    My apps close on their own even when I am using them.  How to fix this?

    Usually cause by low memory
    1. Double-click the Home button to close all Inactive Apps in Task Bar
    2. Hold the Apps down for a second or two until you see the minus sign
    3. Tap the minus sign to close App
    4. Tap center of screen to return to Home Screen
    5. Reset iPad. Hold the Sleep and Home button down for about 10 second until you see the Apple logo. Ignore the red slider

  • How can I disable the Photos app from automatically running when I plug in my iPhone?

    How can I disable the Photos app from automatically running when I plug in my iPhone?
    I have no intention of ever using Photos, in fact, having to abandon Aperture takes me one step close to moving back to Windows, but I digress.
    I just want to NOT have to kill the Photos app every time I plug in my phone.
    Thanks.

    I am still seeing the option Image Capture, like shown in the screenshot that Rysz posted.   But it is another example of the hide-and-seek Apple likes to play with us.
    The option has to be set for each device individually. With the device connected to USB, you have to click the tiny disclosure triangle in the lower left corner of the sidebar to reveal the option.
    I was perfectly happy with the program I paid for (Aperture), and now to maintain the functionality I have to pay for another application (LightRoom) to get the functionality that I paid for in Aperture.
    Aperture 3.6 is working well with Yosemite. I will use it, as long as I have a Mac, that will run Yosemite or a compatible system.
    Have you looked at Capture One?  It looks much more similar to Aperture than Lightroom.

  • Mail app closes when trying to send email

    I can receive mail ok, but when I try to send, it just closes the mail app and goes back to the home page.
    Any suggestions how I can get the mail app working properly again?
    Thanks

    Ah, yes... a common problem.  Relaying is when you are using email service A to send mail through, but your "from" address is another service.  Service A, if it's set up for this, will reject your email because you are trying to relay the email through them from an email address that is not theirs.  This is to prevent spammers from using their service even though they don't have an account with them.
    I suspect the service you are sending to is one on which you have a valid account, but you're sending "from" another address.  In such cases the relaying service may allow you to specify, in your email settings, your account and password, in which case it will accept your email and pass it through.

  • I've got HPePrint App on my ipad, when I touch the photos icon the App closes, HP can't help, has anyone got an ideas for a solution?

    I've got HPePrint App on my ipad, when I touch the photos icon the App closes, HP can't help, has anyone got an ideas for a solution?

    Yes, you should get an email if somebody replies to a thread you started or one to which you posted. I did; that's how I knew you had replied. Check up at the top of the right column of this thread. In the "Actions" box you should find "Stop email notifications" if you are subscribed to this thread.
    One step you didn't list among HP's suggestions is a compound action: delete the app, reset the iPad (by holding down the home and start buttons together for ten seconds), then reinstall the app and test it. If it still falls over, I would say the HP app has not kept up with iOS changes and needs updating -- OR your iPad has developed some persistent internal corruption in its photo storage that only the HP app trips over (in which case, the app still needs updating, but it's going to be much harder for HP to determine how).

  • I am running LR 4.4 on a iMac with OS X (Yosemite).  Everything works in the develop module but when i get to the print module, clicl on print and the apple print dialogue box opens, and I click onn print there, the app closes.  It has now happened about

    I am running LR 4.4 on a iMac with OS X (Yosemite).  Everything works in the develop module but when i get to the print module, clicl on print and the apple print dialogue box opens, and I click onn print there, the app closes.  It has now happened about a dozen times.  I have downloaded LR 4.4 from the internet but the problem continues.

    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    Do they launch OK while in Safe Mode?

  • Since recent updates, I have noticed that my apps close automatically when I am distracted. In some cases it is time consuming to sign back in and get back to the task I was doing. Is it possible to change a setting so the apps will stay open?

    Since recent updates of iOS, I have noticed when using my iPad that my apps close automatically when I have to leave the room or am otherwise distracted for a few minutes. It is sometimes time consuming to sign back in and get back to the task where i left off. Is there a setting I can change so it will keep the apps open until I am ready to close them? Thanks for your help.

    Did you have this problem before Restoring you iPad?
    If you did then did you restore with a backup. You may have reinstalled something that is conflicting in this back up
    If not then sounds like either something went array with the clean install or a hardware issue.
    I know it's long winded but have you tired a clean install then downloading the apps again?
    PJRS

  • I have my credit card on my daughter's i pod and i needed it to set up the apple id how do i make it so she can't spend any of the money but still get free apps.? Also she has a$15 app card on there how do I know when she buys apps which payment it takes?

    I put my credit card on my daughters new i pod. How do I block her from buying apps but still being able to download free apps? Also she has a $15 app card on the i pod how do i know when she buys something whitch payment it will take the visa or app card? PLEASE HELP A.S.A.P. THANK YOU

    You can
    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    You can have apps purchased from more than one account. It does complicate update apps though.
    - Go to settings>Store and sign out and sign into your account.
    - Apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

  • How can i display image in RTF template when Oracle Apps running in Windows

    Can any body help how can i display image in RTF template when oracle apps running in Windows Server.
    Thanks
    Ravi

    Hi Ravi,
    You can add images into your rtf template using MS Word Insert Picture feature.
    Did you try this method?
    Thanks
    Ravi
    [email protected]

  • How can I get my iPhone to stop promting me to enter my wife's Apple ID when updating apps? I've checked settings for iTunes

    How can I get my iPhone 6 to stop prompting me to enter my wife's Apple ID when updating apps? I have verified in settings that my acct is listed in itunes & App Store, as well as icloud. i can download new apps fine. Have shut down phone and re-powered, have tried plugging into my iMac while signed into my iTunes acct. Can't figure out what to do next?

    Is the comp a synced device to your apple ID and approved as an active device for this synchronization?
    Just cloud the sync once, activate the comp to your apple I'd in iTunes, ensure all software is up to date, turn on home sharing between the devices and you can reinstall the apps from the apple id purchase history via download.
    You basically cleaned out the canonical data apple uses to validate all that, which was backup data. Like iOS devices have the purchased option on the App Store now, syncing the devices via the home sharing and properly activating them will give your comp the purchased cloud and free up 10gs of space on the precious solid states smaller drives.
    Hope that helps...
    If you need to know the menu to find this info, let me know. But the info is easily accessible in the help menu.

Maybe you are looking for

  • Print to Video Does not Work

    I am running Final Cut pro 5. I am trying to send my time line to a mindv deck using print to video. I have a monitor hooked up to the deck to watch what is being recorded. I set my in and out points in the time line and and select print to video fro

  • Fillable Form

    Hello, Does any one have any idea, How to generate Fillable form? What I want is, if data exist in xml datafile it should assign to respective form field else let user entre whatever they want to entre. Is it possible to do it? I did design using Acr

  • Time effects : why I don't get anything in Program view?

    What am I missing here: whenever I try to apply a "time" video effect (such as Time warp, echo or else), my program monitor disappear.  I did not have this issue in Premiere CS3.  Am I missing something in the settings ? Thanks, Rob

  • How to find the main sql

    Hi all, I'm working on a 11.2 Oracle Enterprise database. I need a query to find the top 10 queries of my database. Please could you help me? Best regards dbajug

  • Possible to deploy EJB with REPLICATE_BINDINGS == false?

    Is there a way to deploy an EJB with WLContext.REPLICATE_BINDINGS == false?           There does not seem to be a way to do this using deployment descriptors? Is           it possible to deploy the EJB programmatically so I can explicitly specify