If you want to call getApplicationContext in your Foo class, it better to
pass Context reference as a parameter in method DoSomethingWithCurrentContext()
or you can pass in constructor while instantiating the Foo class.
I think there is no other way to access the context object.
On Thu, Oct 8, 200
Phillip wrote:
> I'm trying to retrieve the current application's context indirectly
> from an object that my application uses. For example, I have a MyApp
> class that extends Activity which itself extends Context. From within
> MyApp I declare a variable of type Foo, where Foo is a utility cla
Nope, there is no current context. You need to explicitly supply the
context.
On Wed, Dec 3, 2008 at 4:02 PM, Cezar Augustus Signori <
[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> It would be pretty good to obtain the application context from a
> static method, without the use of an Activity object.
>
3 matches
Mail list logo