On Mon, Mar 14, 2011 at 5:51 PM, maggy mtac <[email protected]> wrote: > I want to known How send information for example String from service > to Activity?
Send a broadcast Intent. Or, have the activity supply a Messenger to the service via an Intent extra, and the service sends a message to the activity via that Messenger. Or, have the activity use createPendingResult() to create a PendingIntent and pass that via an Intent extra, and the service executes that PendingIntent, providing a response that the activity receives in onActivityResult(). Or, if you are using bindService(), have the activity register some sort of listener with the service, which the service uses to send back data. There are probably other options as well. > How start even Activity in a service because i want to display when > the service recover a data , he transmit to even Activity? Do not "start even Activity in a service", unless you KNOW that the user is using your application in the foreground. Use a Notification to alert the user that "the service recover a data", please. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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

