| Start |
|---|
| ActivityNotFoundException This is a very common In this case, check if you have declared your activity in the The simplest way to declare your |
| NetworkOnMainThreadException From the documentation (opens new window): The exception that is thrown when an application attempts to perform a networking operation on its main thread. This is only thrown for applications targeting the Honeycomb SDK or higher. Applications targeting earlier SDK versions are allowed to do networking on their main event loop threads, but it's heavily discouraged. Here's an example of a code fragment that may cause that exception: Above code will throw To avoid this exception, your network operations must always run in a background task via an |
| OutOfMemoryError This is a runtime error that happens when you request a large amount of memory on the heap. This is common when loading a Bitmap into an ImageView. You have some options:
Add the "largeHeap" option to the application tag in your AndroidManifest.xml. This will make more memory available to your app but will likely not fix the root issue.
After loading a bitmap, be sure to recycle it and free up memory:
Avoid loading the entire bitmap into memory at once by sampling a reduced size, using BitmapOptions and inSampleSize. See Android documentation (opens new window) for example |
DexException This error occurs because the app, when packaging, finds two Usually this happens because the app has accidentally acquired 2 separate dependencies on the same library. For instance, say you have a project, and you want to rely on two libraries: To resolve, make sure that none of your dependencies could accidentally be added twice in such a manner |
| UncaughtException If you want to handle uncaught exceptions try to catch them all in onCreate method of you Application class: |
| Registering own Handler for unexpected exceptions This is how you can react to exceptions which have not been catched, similar to the system's standard "Application XYZ has crashed" Then register this Application class in your AndroidManifest.xml: |
Read Article
https://develop.horje.com/learn/1434/reference