Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 26th, 2014, 04:24 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5: Earthquake

I have completed part 1 of the earthquake in chapter 5. When i try to run the app this pops up: Unfortunately, Earthquake has stopped. And in eclipse the logcat pop up and i get this error message:
Code:
01-26 19:59:11.153: W/dalvikvm(859): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
01-26 19:59:11.183: E/AndroidRuntime(859): FATAL EXCEPTION: main
01-26 19:59:11.183: E/AndroidRuntime(859): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.epstudios.earthquake/com.epstudios.earthquake.Earthquake}: android.os.NetworkOnMainThreadException
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.os.Looper.loop(Looper.java:137)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread.main(ActivityThread.java:4745)
01-26 19:59:11.183: E/AndroidRuntime(859):  at java.lang.reflect.Method.invokeNative(Native Method)
01-26 19:59:11.183: E/AndroidRuntime(859):  at java.lang.reflect.Method.invoke(Method.java:511)
01-26 19:59:11.183: E/AndroidRuntime(859):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-26 19:59:11.183: E/AndroidRuntime(859):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-26 19:59:11.183: E/AndroidRuntime(859):  at dalvik.system.NativeStart.main(Native Method)
01-26 19:59:11.183: E/AndroidRuntime(859): Caused by: android.os.NetworkOnMainThreadException
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
01-26 19:59:11.183: E/AndroidRuntime(859):  at java.net.InetAddress.lookupHostByName(InetAddress.java:385)
01-26 19:59:11.183: E/AndroidRuntime(859):  at java.net.InetAddress.getAllByNameImpl(InetAddress.java:236)
01-26 19:59:11.183: E/AndroidRuntime(859):  at java.net.InetAddress.getAllByName(InetAddress.java:214)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:341)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:273)
01-26 19:59:11.183: E/AndroidRuntime(859):  at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
01-26 19:59:11.183: E/AndroidRuntime(859):  at com.epstudios.earthquake.Earthquake.refreshEarthquakes(Earthquake.java:71)
01-26 19:59:11.183: E/AndroidRuntime(859):  at com.epstudios.earthquake.Earthquake.onCreate(Earthquake.java:57)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.Activity.performCreate(Activity.java:5008)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-26 19:59:11.183: E/AndroidRuntime(859):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
01-26 19:59:11.183: E/AndroidRuntime(859):  ... 11 more
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Earthquake Chapter 6 newbie123 BOOK: Professional Android 4 Application Development 7 January 21st, 2013 06:09 AM
Chapter 7 Earthquake 2, Earthquake.java, error onActivityResult dbomberg BOOK: Professional Android 2 Application Development 2 November 30th, 2012 04:52 AM
Chapter 9 Earthquake 1 MellowFellow BOOK: Professional Android 2 Application Development 14 August 23rd, 2010 04:40 PM
Please help: Chapter 9 Earthquake 4 dahe BOOK: Professional Android 2 Application Development 0 July 21st, 2010 03:41 PM
chapter 5 Earthquake EricTapia BOOK: Professional Android 2 Application Development 2 April 14th, 2010 12:47 AM



All times are GMT -4. The time now is 10:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.