

If the service is designed with a client-server interface, you can bind to the service from another component by passing an Intent to bindService(). The Intent describes the service to start and carries any necessary data. You can start a service to perform a one-time operation (such as download a file) by passing an Intent to startService(). For more information, see the Activities guide.Ī Service is a component that performs operations in the background without a user interface. Your activity receives the result as a separate Intent object in your activity’s onActivityResult() callback.

If you want to receive a result from the activity when it finishes, call startActivityForResult(). The Intent describes the activity to start and carries any necessary data. You can start a new instance of an Activity by passing an Intent to startActivity(). Although intents facilitate communication between components in several ways, there are three fundamental use-cases:Īn Activity represents a single screen in an app. An Intent is a messaging object you can use to request an action from another app component.
