Thanks for replying.. Exactly what I wanted.. Solves one scenario in my application..
Here is the other, I intend to use a Alarm in my application, which periodically connects to a web service to update my database. Here no activity is involved. I intend to make it a background service. But this class needs to access the database. How do I do that? Also, periodically connecting to a web service to update a database is a bad practice? Btw, your book is great :).. thanks.. Regards, Immanuel On Jan 28, 9:09 pm, Mark Murphy <mmur...@commonsware.com> wrote: > Immy wrote: > > Hi, > > > Thanks for the reply.. > > > This is what I'm doing in all other classes, which happen to be > > Activities... > > But here, > > > Database_mob mDbHelper = new Database_mob(this); > > > generates an error which says Database_mob(*classname*) is undefined. > > That would be because classname is not a Context subclass. > > If classname is an inner class, use MyActivity.this instead, where > MyActivity is the name of the activity class (or other Context). > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---