That works pretty well, but I'd suggest you read up on using the MVP pattern to keep your activities from becoming an unmanageable cluster of spaghetti-code.
I'm in the process of refactoring a bunch of code to do that now, and it makes unit testing them super simple. In my case, the activity calls a "presenter" method that does all the async work, then the presenter calls the view (Activity) back once it's done (and passes it the data). Also, look into "command services", they aren't any more complex than AsyncTask and for what you're describing, they might do what you want. Larry On Mon, Feb 25, 2013 at 11:25 AM, stanlick <[email protected]> wrote: > I have been experimenting with an easy way to execute "synch" type bursts > without all the hassle of Services, Loaders, Threads, etc. I have come up > with a technique that works great, but I'd like to get a consensus regarding > the pattern. I am performing sendBroadcast("synch.my.app") from the > activity needing an update. This same activity is registering a broadcast > receiver registerReceiver(payload, new IntentFilter("here.is.the.json")) > which is being notified from the "synch.my.app" receiver. In other words, > my broadcastreceiver is calling me back once it has the data. Is this > crazy? I'm simply poking my json payload into the intent before sending > broadcast back to activity. > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

