Tuesday, August 28, 2012

Re: [android-developers] global_context

you shouldn't be passing the context all over the place, you should be
getting by the methods defined for the specific activities, services,
etc..

Why are you passing it around so often?

P.s., *no*, it won't always be the same.

kris

On Tue, Aug 28, 2012 at 3:17 PM, bob <bob@coolfone.comze.com> wrote:
> It is getting very cumbersome having to pass a Context object all over when
> I'm pretty sure it never should change.
>
> Is this so bad?
>
>
>
> public class MyApplication extends Application {
>
> public static Context global_context;
>
> @Override
> public void onCreate() {
> global_context = this;
> super.onCreate();
> }
>
> }
>
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment