To provide binding for a service, you must implement the onBind() callback method.
To create a bound service, implement the onBind() callback method to return an IBinder that defines the interface for communication with the service.
Чтобы создать привязанную службу, необходимо реализовать метод обратного вызова onBind() для возвращения объекта IBinder, который определяет интерфейс взаимодействия со службой.
This interface between the service and a client must be an implementation of IBinder and is what your service must return from the onBind() callback method.
Этот интерфейс между службой и клиентом должен быть реализацией объекта IBinder, которую ваша служба должна возвращать из метода обратного вызова onBind().
To provide a layout for a fragment, you must implement the onCreateView() callback method, which the Android system calls when it's time for the fragment to draw its layout.
Чтобы создать макет для фрагмента, разработчик должен реализовать метод обратного вызова onCreateView(), который система Android вызывает, когда для фрагмента наступает время отобразить свой макет.
Return this instance of Binder from the onBind() callback method.
The onCreate() callback method in your Activity is called by the Android framework when your Activity is launched (see the discussion about lifecycles, in the Activities document).
Метод обратного вызова onCreate() в вашей операции вызывается платформой Android во время запуска операции (см. сведения о жизненных циклах в документе Операции).
For more information about creating a service that provides binding, see the Bound Services document, which includes more information about the onRebind() callback method in the section about Managing the lifecycle of a bound service.
Дополнительные сведения о создании службы, которая обеспечивает привязку, см. в документе Привязанные службы, который содержит дополнительную информацию о методе обратного вызова onRebind() в разделе Управление жизненным циклом привязанной службы.
This is also the behavior of the OneWayAttribute attribute when applied to callback method signatures.
In the client, receive the Binder from the onServiceConnected() callback method and make calls to the bound service using the methods provided.
В клиенте получите класс Binder от метода обратного вызова onServiceConnected() и выполните вызовы к привязанной службе с помощью предоставленных методов.
Alte rezultate
These are the most important callback methods that you should override:
In this figure, you can see how each successive state of the activity determines which callback methods a fragment may receive.
На этом рисунке можно видеть, что очередное состояние операции определяет, какие методы обратного вызова может принимать фрагмент.
Your implementation must override two callback methods:
In your implementation, you must override some callback methods that handle key aspects of the service lifecycle and provide a mechanism that allows the components to bind to the service, if appropriate.
В вашей реализации необходимо переопределить некоторые методы обратного вызова, которые обрабатывают ключевые моменты жизненного цикла службы и при необходимости предоставляют механизм привязывания компонентов.