Tuesday, November 2, 2010

Re: [android-developers] How to pass a Context variable from one Activity to another ?

On Tue, Nov 2, 2010 at 7:06 PM, Emre A. Yavuz <eaylist@hotmail.com> wrote:
Let's assume I'd like to pass a Context variable in my MainActivity to either Activity "A" or "B.

Why would you want to pass a Context variable to either of two instances of objects that themselves derive from Context?
 
How should I do it, what is the most efficient approach ? Any suggestions ?

Uh ... don't. Just use the Activity itself as the Context.

Why do you think you need to pass a Context instance around?

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

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