make object of the class in which u have to use the context ......... Then
pass as parameter this to the class ............ And the class in which u
have to use conext should have constructor as parameter context in it

e.g


class activity extends Activity
{
     Viewclass myclass;
      public oncreate()
      {
         myclass = new Viewclass (this);

       }
}

-----------------------------------------------

class Viewclass
{
    public Viewclass (Context context)
   {
    }
}



>
> On Wed, Jan 28, 2009 at 12:43 PM, Immy <[email protected]> wrote:
>
>>
>> Hi,
>>
>> Can anyone tell me how to access context of a class which is not an
>> activity?
>>
>> Thanks,
>> Immanuel
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to