Exceptions and Code Handling
Learn how to handle errors and exceptions in Android.
Introduction to exceptions
Every program, new or old, has an exception handling mechanism in place because exceptions will always occur. The problem is not the exceptions themselves, but how they’re handled so that we avoid crashes and unexpected events happening on the user’s end. Poor exception handling results in bad user experience.
Exception handling can control errors in the program and avoid abnormal program termination by throwing messages about the exception. This essentially means that the entire program won’t have to be terminated, and that the exception will be caught using try/catch methods.
Get hands-on with 1400+ tech skills courses.