Yes, I know that. But I got a situation it's not possible. I'm extending the URLStreamHandlerFactory and the URLStreamHandler, and I'm needing to pass the context reference to my URLStreamHandler object. The URLStreamHandler objects are created using the URLStreamHandlerFactory (obviously), but it's done by the URL class when it's created. Unfortunately, I cannot reimplement URL class since it's a final class, so I cannot change the way it involkes the URLStreamHandlerFactory to create the URLStreamHandler : (
So, I needed to access the context that involked the "new URL(args)" to access its rescources. But I cannot pass the Context object as reference : ( Regards, Adriano Crestani On Apr 10, 12:54 am, Zach Hobbs <[EMAIL PROTECTED]> wrote: > Activity is a subclass of ApplicationContext, so in an Activity you can just > use "this". > > -- > > Zach Hobbs > HelloAndroid.com > Android OS news, tutorials, downloads > > On Thursday 10 April 2008 02:43:35 Adriano Crestani wrote: > > > Is there a way to get a reference to an ApplicationContext object? > > Something like getContext(int id). > > > I'm creating a library and I need to access a resource from the > > application that is using this library. But I need a reference to this > > application to call its getResources() method. > > > Thanks in advance ; ) > > > Adriano Crestani --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

