OK so I successfully got my app working with a few real-time graphs. I do all of my graph updating in my one activity of my tabbed app. However I wanted to now move the updating of my graph data into a service such that the data can still be collected and populated while the app is in the background, i.e. not in focus. But for the life of me I keep getting a null pointer exception error and i can't solve it. It is difficult to post all of the code in this post, so perhaps i can link it and just describe what i am attempting.
the 2 activities in question are RegistersActivity, which does all the graph functions, and BatteryCalibratorService, which i want to only call on RegistersActivity and update the graph accordingly. with all the code placed in one activity, RegistersActivity, the graph populates correctly just fine. but as soon as i move my handler and runnable to my service, and attempt to call on my activity function from the service, i get the NPE. specifically the error happens at line 91 mDisplay.populateGraph(); of this service: http://github.com/R0gerP0dacter/BatteryCalibrator/blob/master/src/net/jonrichards/batterycalibrator/ui/BatteryCalibratorService.java the error happens simultaneously when i call my populateGraph function from my service, it errors at line 290 mCurrentSeries.clear(); of the activity: http://github.com/R0gerP0dacter/BatteryCalibrator/blob/master/src/net/jonrichards/batterycalibrator/ui/RegistersActivity.java the errors are linked, i.e. one is caused by the other, but i just can't understand why. with all code in one main activity, everything works just fine. but as soon as i try to use a service to call on my activity function (mDisplay.populateGraph()), i get the null pointer exception error. Hope this isn't too much to ask. and yes i am a very novice/ beginner/moderate coder, so please forgive if this is a dumb question! thanks. RP -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

