In your documentation i found an example to cancel the registration of a device:
try{ Backendless.Messaging.unregisterDevice();}catch( BackendlessException exception ){ // either device is not registered or an error occurred during de-registration}
When my device is registered it works fine.
But if device is not registered my app is crashing, it is not going to “catch” block
java.lang.IllegalArgumentException: Device is not registered.
at com.backendless.Messaging$3.doInBackground(Messaging.java:275)
at com.backendless.Messaging$3.doInBackground(Messaging.java:266)
at android.os.AsyncTask$2.call(AsyncTask.java)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)