If the class only lives as long as the activity does, then you can probably get away with passing around the activity. However, for some basic network code, you might as well just keep it on your activity class. For example, you can use AsyncTask or just declare a handler and thread.
On Tue, Sep 6, 2011 at 4:12 PM, TreKing <[email protected]> wrote: > On Tue, Sep 6, 2011 at 12:37 AM, krishna chaitanya > <[email protected]> wrote: >> >> So, my question is how do call the methods in activity. Is it just >> by passing the "this pointer" ? > > In Java it's a reference, not a pointer, but yes, that could work. In > general I'd advise against passing around an Activity instance, but I guess > it's up to you. > >> >> Is it a good programming logic to pass activity's "this" across different >> class? > > That's very hard to answer in absolute terms with no context. > > ------------------------------------------------------------------------------------------------- > 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 [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 -- ~ Jeremiah:9:23-24 Android 2D MMORPG: http://solrpg.com/, http://www.youtube.com/user/revoltingx -- 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

