AI’s Greatest Moments: Celebrating Artificial Intelligence Appreciation Day
Discover the most remarkable achievements in artificial intelligence as we honor AI’s Greatest Moments on Artificial Intelligence Appreciation Day.
In android system, activity gets destroy in two scenarios.
1. When user press back button or write code in activity to destroy itself.
2. When activity is currently in paused/stopped state and it is not used in for a long time and current foreground activity requires more memory or resources.
Android system forcibly killed that activity and store it’s all member variables values in a bundle. If user destroy activity according to his/her wish then it doesn’t matter but if android system kills that activity without knowing to user, it may lead to app crash. To avoid such a situation programmer should use smart trick. For programmer it is necessary to implement that trick in his/her coding.
He/She should use onstop() callback method to release all occupied system resources and let the activity to use those resources and also implement onSaveInstanceState() callback method to store all member variables values into android system’s bundle.
When activity recreates itself then data can be recovered by that bundle. It will help to programmer to regain data in case when android system kills your activity. Through this smart trick programmer can avoid accidental app crash and also can make it to more effective in such accidental cases.
Jul 16th, 2024
Discover the most remarkable achievements in artificial intelligence as we honor AI’s Greatest Moments on Artificial Intelligence Appreciation Day.
Jul 11th, 2024
Discover the best methods for adding your blogs to your GitHub profile. Enhance your visibility and engage more followers. Click for detailed guide.
Jun 18th, 2024
Learn about the groundbreaking features of iOS 18 and why it’s considered the most impressive update to date. Stay ahead with our detailed insights.