Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Professional Android 2 Application Development
Password Reminder
Register
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 Search this Thread Display Modes
  #1 (permalink)  
Old April 24th, 2010, 03:17 PM
Registered User
 
Join Date: Apr 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Exception after the Correction -for Chapter 6 Part 2 Earthquake project

I posted this quested in reponse to a different post but no one has replied. Here is my problem:

When I am running the Chapter 6 part 2 (page 202) I get an exception when I click the "Preferences" button on the emulator. Here is the LogCat:




04-23 00:47:17.686: DEBUG/NetworkLocationProvider(58): onDataConnectionStateChanged 0
04-23 00:47:17.766: DEBUG/MobileDataStateTracker(58): default Received state= DISCONNECTED, old= CONNECTED, reason= radioTurnedOff, apnTypeList= default
04-23 00:47:17.818: DEBUG/NetworkStateTracker(58): setDetailed state, old =CONNECTED and new state=DISCONNECTED
04-23 00:47:18.787: DEBUG/ConnectivityService(58): ConnectivityChange for MOBILE: DISCONNECTED/DISCONNECTED
04-23 00:47:19.165: DEBUG/MobileDataStateTracker(58): default Received state= DISCONNECTED, old= DISCONNECTED, reason= gprsDetached, apnTypeList= default
04-23 00:47:19.546: DEBUG/NetworkLocationProvider(58): updateNetworkState(): Updating network state to 1
04-23 00:47:19.546: DEBUG/GpsLocationProvider(58): updateNetworkState unavailable info: NetworkInfo: type: MOBILE[UNKNOWN], state: DISCONNECTED/DISCONNECTED, reason: radioTurnedOff, extra: (none), roaming: false, failover: false, isAvailable: false
04-23 00:47:22.436: DEBUG/dalvikvm(261): Trying to load lib /system/lib/libjni_latinime.so 0x43d02bc8
04-23 00:47:22.476: DEBUG/dalvikvm(261): Added shared lib /system/lib/libjni_latinime.so 0x43d02bc8
04-23 00:47:24.827: DEBUG/dalvikvm(253): GC freed 3947 objects / 237720 bytes in 979ms
04-23 00:47:24.946: ERROR/ActivityThread(253): Failed to find provider info for android.server.checkin
04-23 00:47:24.995: WARN/Checkin(253): Can't update stat PHONE_GSM_REGISTERED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats
04-23 00:47:25.517: DEBUG/NetworkLocationProvider(58): onDataConnectionStateChanged 3
04-23 00:47:26.416: DEBUG/MobileDataStateTracker(58): default Received state= DISCONNECTED, old= DISCONNECTED, reason= (unspecified), apnTypeList= default
04-23 00:47:27.445: DEBUG/MccTable(253): updateMccMncConfiguration: mcc=310, mnc=260
04-23 00:47:27.467: DEBUG/MccTable(253): locale set to en_us
04-23 00:47:27.675: DEBUG/MccTable(253): WIFI_NUM_ALLOWED_CHANNESL set to 11
04-23 00:47:27.736: INFO/WifiService(58): WifiService trying to setNumAllowed to 11 with persist set to false
04-23 00:47:29.206: DEBUG/TelephonyProvider(253): Setting numeric '310260' to be the current operator
04-23 00:47:29.506: ERROR/ActivityThread(253): Failed to find provider info for android.server.checkin
04-23 00:47:29.536: WARN/Checkin(253): Can't update stat PHONE_GPRS_ATTEMPTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats
04-23 00:47:29.605: DEBUG/NetworkLocationProvider(58): onDataConnectionStateChanged 3
04-23 00:47:29.786: DEBUG/MobileDataStateTracker(58): default Received state= CONNECTING, old= DISCONNECTED, reason= simLoaded, apnTypeList= *
04-23 00:47:29.866: DEBUG/NetworkStateTracker(58): setDetailed state, old =DISCONNECTED and new state=CONNECTING
04-23 00:47:29.976: DEBUG/ConnectivityService(58): ConnectivityChange for MOBILE: CONNECTING/CONNECTING
04-23 00:47:30.367: ERROR/ActivityThread(253): Failed to find provider info for android.server.checkin
04-23 00:47:30.377: WARN/Checkin(253): Can't update stat PHONE_GPRS_CONNECTED: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/stats
04-23 00:47:30.446: DEBUG/NetworkLocationProvider(58): onDataConnectionStateChanged 3
04-23 00:47:30.715: DEBUG/MobileDataStateTracker(58): default Received state= CONNECTED, old= CONNECTING, reason= simLoaded, apnTypeList= *
04-23 00:47:30.797: DEBUG/MobileDataStateTracker(58): CONNECTED event did not supply interface name.
04-23 00:47:30.817: DEBUG/NetworkStateTracker(58): setDetailed state, old =CONNECTING and new state=CONNECTED
04-23 00:47:30.845: DEBUG/ConnectivityService(58): ConnectivityChange for MOBILE: CONNECTED/CONNECTED
04-23 00:47:30.906: VERBOSE/NetworkStateTracker(58): Setting TCP values: [4094,87380,110208,4096,16384,110208] which comes from [net.tcp.buffersize.umts]
04-23 00:47:30.967: DEBUG/MobileDataStateTracker(58): replacing old mInterfaceName (null) with null for mms
04-23 00:47:31.166: DEBUG/MobileDataStateTracker(58): replacing old mInterfaceName (null) with null for supl
04-23 00:47:31.206: DEBUG/MobileDataStateTracker(58): replacing old mInterfaceName (null) with null for dun
04-23 00:47:31.266: DEBUG/MobileDataStateTracker(58): replacing old mInterfaceName (null) with null for hipri
04-23 00:47:31.547: DEBUG/dalvikvm(240): GC freed 4507 objects / 219992 bytes in 2342ms
04-23 00:47:31.646: DEBUG/ConnectivityService(58): adding dns 10.0.2.3 for MOBILE
04-23 00:47:31.856: DEBUG/NetworkLocationProvider(58): updateNetworkState(): Updating network state to 2
04-23 00:47:31.876: DEBUG/GpsLocationProvider(58): updateNetworkState available info: NetworkInfo: type: MOBILE[UMTS], state: CONNECTED/CONNECTED, reason: simLoaded, extra: internet, roaming: false, failover: false, isAvailable: true
04-23 00:47:31.916: DEBUG/GpsLocationProvider(58): NetworkThread wait for 9223372036854775807ms
04-23 00:47:35.345: DEBUG/dalvikvm(240): GC freed 10939 objects / 493296 bytes in 362ms
04-23 00:47:38.895: DEBUG/dalvikvm(240): GC freed 17360 objects / 794568 bytes in 435ms
04-23 00:47:39.797: INFO/ARMAssembler(58): generated scanline__00000177:03515104_00001A01_00000000 [ 73 ipp] (98 ins) at [0x368c18:0x368da0] in 2367899 ns
04-23 00:47:39.867: WARN/InputManagerService(58): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$ Proxy@43cb4800
04-23 00:47:40.377: DEBUG/dalvikvm(106): GC freed 575 objects / 30440 bytes in 2313ms
04-23 00:47:43.076: DEBUG/dalvikvm(163): GC freed 1729 objects / 82424 bytes in 311ms
04-23 00:47:46.285: WARN/KeyCharacterMap(240): No keyboard for id 0
04-23 00:47:46.305: WARN/KeyCharacterMap(240): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
04-23 00:47:48.196: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.paad.earthquake/.Preferences }
04-23 00:47:48.675: DEBUG/AndroidRuntime(240): Shutting down VM
04-23 00:47:48.685: WARN/dalvikvm(240): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-23 00:47:48.731: ERROR/AndroidRuntime(240): Uncaught handler: thread main exiting due to uncaught exception
04-23 00:47:48.896: ERROR/AndroidRuntime(240): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.paad.earthquake/com.paad.earthquake.Preferences}: android.view.InflateException: Binary XML file line #2: Error inflating class PreferencesScreen
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2496)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2512)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread.access$2200(ActivityThr ead.java:119)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1863)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.os.Handler.dispatchMessage(Handler.java:99 )
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.os.Looper.loop(Looper.java:123)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread.main(ActivityThread.jav a:4363)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at java.lang.reflect.Method.invokeNative(Native Method)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at java.lang.reflect.Method.invoke(Method.java:521)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:860)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:618)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at dalvik.system.NativeStart.main(Native Method)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class PreferencesScreen
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.createItemFromT ag(GenericInflater.java:441)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.inflate(Generic Inflater.java:317)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.inflate(Generic Inflater.java:263)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.PreferenceManager.inflateFromRe source(PreferenceManager.java:254)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.PreferenceActivity.addPreferenc esFromResource(PreferenceActivity.java:253)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at com.paad.earthquake.Preferences.onCreate(Preferenc es.java:18)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1047)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2459)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): ... 11 more
04-23 00:47:48.896: ERROR/AndroidRuntime(240): Caused by: java.lang.ClassNotFoundException: android.preference.PreferencesScreen in loader dalvik.system.PathClassLoader@43d02888
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at dalvik.system.PathClassLoader.findClass(PathClassL oader.java:243)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 73)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 32)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.createItem(Gene ricInflater.java:375)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.onCreateItem(Ge nericInflater.java:417)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): at android.preference.GenericInflater.createItemFromT ag(GenericInflater.java:428)
04-23 00:47:48.896: ERROR/AndroidRuntime(240): ... 18 more
04-23 00:47:49.137: INFO/Process(58): Sending signal. PID: 240 SIG: 3
04-23 00:47:49.156: INFO/dalvikvm(240): threadid=7: reacting to signal 3
04-23 00:47:49.317: INFO/dalvikvm(240): Wrote stack trace to '/data/anr/traces.txt'
04-23 00:47:52.317: INFO/Process(240): Sending signal. PID: 240 SIG: 9
04-23 00:47:52.607: ERROR/gralloc(58): [unregister] handle 0x3867d0 still locked (state=40000001)
04-23 00:47:52.787: INFO/ActivityManager(58): Process com.paad.earthquake (pid 240) has died.
04-23 00:47:52.796: INFO/WindowManager(58): WIN DEATH: Window{43ddf000 AtchDlg:com.paad.earthquake/com.paad.earthquake.Earthquake paused=false}
04-23 00:47:52.916: INFO/WindowManager(58): WIN DEATH: Window{43d03c58 com.paad.earthquake/com.paad.earthquake.Earthquake paused=false}
04-23 00:47:53.197: INFO/ActivityManager(58): Start proc com.paad.earthquake for activity com.paad.earthquake/.Earthquake: pid=279 uid=10026 gids={3003, 1015}
04-23 00:47:54.147: DEBUG/ddm-heap(279): Got feature list request
04-23 00:47:54.545: INFO/UsageStats(58): Unexpected resume of com.paad.earthquake while already resumed in com.paad.earthquake
04-23 00:47:54.745: INFO/ActivityManager(58): Displayed activity com.paad.earthquake/.Earthquake: 1740 ms (total 6371 ms)
04-23 00:47:55.896: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 240 uid 10026



Please help me trouble shoot this. As I have tried the corrections as given to me by previous response to this post.

Christian
Reply With Quote
  #2 (permalink)  
Old April 26th, 2010, 06:03 AM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

The problem here is that you've misspelt "PreferenceScreen" in the 2nd (and probably also the last) line of your userpreferences.xml file.

Looking at the error log it seems you've written
Code:
PreferencesScreen
where it should be
Code:
PreferenceScreen
(no plural!)
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Chapter11 Earthquake project did not build. How I got it working burtbick BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 2 October 30th, 2010 05:21 AM
Chapter 12 - Running OfficialFileSTSADMCommand project gets Unhandled Exception. dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 September 3rd, 2009 09:52 PM
Chapter 5 - WebServiceExample project gets exception dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:06 AM



All times are GMT -4. The time now is 03:29 PM.


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