ServiceConnection
public
interface
ServiceConnection
| android.content.ServiceConnection |
|
|
Interface for monitoring the state of an application service. See
Service and
Context.bindService() for more information.
Like many callbacks from the system, the methods on this class are called from the main thread of your process.
Summary
Public methods | |
|---|---|
default
void
|
onBindingDied(ComponentName name)
Called when the binding to this connection is dead. |
abstract
void
|
onServiceConnected(ComponentName name, IBinder service)
Called when a connection to the Service has been established, with
the |
abstract
void
|
onServiceDisconnected(ComponentName name)
Called when a connection to the Service has been lost. |
Public methods
onBindingDied
void onBindingDied (ComponentName name)
Called when the binding to this connection is dead. This means the interface will never receive another connection. The application will need to unbind and rebind the connection to activate it again. This may happen, for example, if the application hosting the service it is bound to has been updated.
| Parameters | |
|---|---|
name |
ComponentName: The concrete component name of the service whose
connection is dead.
|
onServiceConnected
void onServiceConnected (ComponentName name, IBinder service)
Called when a connection to the Service has been established, with
the IBinder of the communication channel to the
Service.
| Parameters | |
|---|---|
name |
ComponentName: The concrete component name of the service that has
been connected. |
service |
IBinder: The IBinder of the Service's communication channel,
which you can now make calls on.
|
onServiceDisconnected
void onServiceDisconnected (ComponentName name)
Called when a connection to the Service has been lost. This typically
happens when the process hosting the service has crashed or been killed.
This does not remove the ServiceConnection itself -- this
binding to the service will remain active, and you will receive a call
to onServiceConnected(ComponentName, IBinder) when the Service is next running.
| Parameters | |
|---|---|
name |
ComponentName: The concrete component name of the service whose
connection has been lost.
|
Interfaces
- ClipboardManager.OnPrimaryClipChangedListener
- ComponentCallbacks
- ComponentCallbacks2
- ContentProvider.PipeDataWriter
- DialogInterface
- DialogInterface.OnCancelListener
- DialogInterface.OnClickListener
- DialogInterface.OnDismissListener
- DialogInterface.OnKeyListener
- DialogInterface.OnMultiChoiceClickListener
- DialogInterface.OnShowListener
- EntityIterator
- IntentSender.OnFinished
- Loader.OnLoadCanceledListener
- Loader.OnLoadCompleteListener
- ServiceConnection
- SharedPreferences
- SharedPreferences.Editor
- SharedPreferences.OnSharedPreferenceChangeListener
- SyncStatusObserver
Classes
- AbstractThreadedSyncAdapter
- AsyncQueryHandler
- AsyncQueryHandler.WorkerArgs
- AsyncQueryHandler.WorkerHandler
- AsyncTaskLoader
- BroadcastReceiver
- BroadcastReceiver.PendingResult
- ClipboardManager
- ClipData
- ClipData.Item
- ClipDescription
- ComponentName
- ContentProvider
- ContentProviderClient
- ContentProviderOperation
- ContentProviderOperation.Builder
- ContentProviderResult
- ContentQueryMap
- ContentResolver
- ContentUris
- ContentValues
- Context
- ContextWrapper
- CursorLoader
- Entity
- Entity.NamedContentValues
- Intent
- Intent.FilterComparison
- Intent.ShortcutIconResource
- IntentFilter
- IntentFilter.AuthorityEntry
- IntentSender
- Loader
- Loader.ForceLoadContentObserver
- MutableContextWrapper
- PeriodicSync
- QuickViewConstants
- RestrictionEntry
- RestrictionsManager
- SearchRecentSuggestionsProvider
- SyncAdapterType
- SyncContext
- SyncInfo
- SyncRequest
- SyncRequest.Builder
- SyncResult
- SyncStats
- UriMatcher
- UriPermission
Exceptions