I'm really new to this, so just flog me if I give bad information. However,
I think you should set up your ConnectSocket as a Service. Then in each of
your Activities, you bind to that service and access your send and receive
methods directly. I recently went through some struggles that were resolved
here in this group. You'll need put any code that accesses the Service in
the onServiceConnected().

I have a very similar approach to my application, which works great
(mostly). I have a problem catching Socket errors when I give it the wrong
port or ip address. (I have unanswered posts on that topic)

I haven't tried to run your code, but doesn't "ConnectSocket socket = new
ConnectSocket();" just instanciate a new ConnectSocket or does this somehow
make use of the Runnable?
J
On Thu, Apr 8, 2010 at 3:02 AM, Frank Weiss <[email protected]> wrote:

> I simply followed the SDK reference for AsyncTask at developer.android.com.
> I did run into some gothchas. You really really need to pay attention to
> which methods can and cannot call the methods in your Activity. But once you
> get it right it's solid. I use it to make a request to a server and display
> a map based on a GeoRSS XML response.
>
> Romain Guy's Photostream sample app uses an older version of AsyncTask, but
> the app is a great model, almost a "kitchen sink" of async requests to the
> Flickr API, notifications, and alarm timers.
>
> --
> 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]<android-developers%[email protected]>
> 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 [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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to