RE: [android-beginners] Re: Unable to start service

2010-07-15 Thread sachin.ravi
You can use getApplicationContext() or current class.this (means if your class name is Abc then use like this Abc.this) -Original Message- From: android-beginners@googlegroups.com [mailto:android-beginn...@googlegroups.com] On Behalf Of Bret Foreman Sent: Friday, July 02, 2010 10:32 PM To

Re: [android-beginners] Re: Unable to start service

2010-07-03 Thread Mark Murphy
On Sat, Jul 3, 2010 at 1:45 PM, Bret Foreman wrote: > OK, so let me state where we stand at the moment. Current code to > start service: > >                                        Intent myIntent = new Intent(); >                                        myIntent.setClass(MainActivity.this, > Senso

Re: [android-beginners] Re: Unable to start service

2010-07-02 Thread Mark Murphy
On Fri, Jul 2, 2010 at 1:02 PM, Bret Foreman wrote: > Intent.setClass needs a Context for the first argument. Replacing > cb.getContext with "this" causes a compiler error. Do you mean I > should call getApplicationContext? No, I mean you should use the proper value of "this". Your code is: try