ucsb-cs56-projects / cs56-android-smoke-signals

-
GNU General Public License v3.0
1 stars 7 forks source link

Main Thread Error #56

Closed BrianEKim closed 6 years ago

BrianEKim commented 6 years ago

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

seemantasaha commented 6 years ago

W18 OK for 300 points.

seemantasaha commented 6 years ago

Resolved. Solved the bug. But implementation should be changed solving #61