Error: Caused by: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
After research a Query has to be performed on a worker thread, otherwise the application crashes. In our program, there is an assertNotMainThread to prevent the program from crashing. Queries are synchronous, meaning that they will be run on the same thread your triggering it from. If that's the main thread we will get an error.
-Learn basics of Android
-Learn basics of SMS Broadcast Reciever
-Threads and how to take inputs into Threads from inside a function
Error: Caused by: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time. After research a Query has to be performed on a worker thread, otherwise the application crashes. In our program, there is an assertNotMainThread to prevent the program from crashing. Queries are synchronous, meaning that they will be run on the same thread your triggering it from. If that's the main thread we will get an error. -Learn basics of Android -Learn basics of SMS Broadcast Reciever -Threads and how to take inputs into Threads from inside a function