View Single Post
  #5 (permalink)  
Old March 5th, 2016, 11:05 AM
Kees Kees is offline
Authorized User
Points: 89, Level: 1
Points: 89, Level: 1 Points: 89, Level: 1 Points: 89, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 6 not working

Hi Stephanie,
I remember a problem with the code of chapter 6 (no list at all)

In 2013 i found this exception in logcat :

"android.view.ViewRoot$CalledFromWrongThreadEx cept ion: Only the original thread that created a view hierarchy can touch its views"
If so, then it is likely due to calling aa.notifyDataSetChanged() in earthquakeListfragment.java from the thread that started refreshEarthquakes().
So the code in the book with the thread does not (always) work!!

You could try the chapter 9 example, where EarthquakeUpdateService is used.
Good luck!
Reply With Quote