Search code examples
androidreact-nativemobile-application

Where can I find Android's onDestroy() method


I'm developing an App using React-Native. I have implemented a Camera package, but when I take a picture, the pictures are not saved to my temporary gallery. I'm given an error in the console which leaves me to believe that the problem is that I need to first delete the existing cache directory, so that a new one can be created. Error below

5:59:08 PM: [Error: Directory 'file:///data/user/0/host.exp.exponent/files/ExperienceData/%2540anonymous%252Fsurf-app-4cd0edb5-6a9f-4172-b7a4-9d7df74efccb/photos' could not be created.] Directory exists

From my prior investigation, I have concluded that I need to find the onDestroy() method and re-write it. Do I need to download an android application on my PC that will allow me to navigate to the file that holds this method? How does one find and edit the OnDestroy() method?


Solution

  • It's difficult to understand you problem. Is it an Android related issue?

    onDestroy() method is one of the most common life cycle event for an Android application. If you are building an app using Fragment or Activity, you can easily find this method inside these class, thus it won't be that difficult if you want to override this method in you custom fragment or activity class.