Context.BindServiceAsUser Methode

Definition

Überlädt

BindServiceAsUser(Intent, IServiceConnection, Context+BindServiceFlags, UserHandle)

[Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;Landroid/content/Context$BindServiceFlags;Landroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_Landroid_content_Context_BindServiceFlags_Landroid_os_UserHandle_Handler", ApiSince=34)]
public virtual bool BindServiceAsUser(Android.Content.Intent service, Android.Content.IServiceConnection conn, Android.Content.Context.BindServiceFlags flags, Android.OS.UserHandle user);
[<Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;Landroid/content/Context$BindServiceFlags;Landroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_Landroid_content_Context_BindServiceFlags_Landroid_os_UserHandle_Handler", ApiSince=34)>]
abstract member BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * Android.Content.Context.BindServiceFlags * Android.OS.UserHandle -> bool
override this.BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * Android.Content.Context.BindServiceFlags * Android.OS.UserHandle -> bool

Parameter

service
Intent
user
UserHandle

Gibt zurück

Attribute

Gilt für:

BindServiceAsUser(Intent, IServiceConnection, Int32, UserHandle)

Bindet auf dieselbe user Weise an einen Dienst wie #bindService.

[Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_ILandroid_os_UserHandle_Handler", ApiSince=30)]
public virtual bool BindServiceAsUser(Android.Content.Intent service, Android.Content.IServiceConnection conn, int flags, Android.OS.UserHandle user);
[<Android.Runtime.Register("bindServiceAsUser", "(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z", "GetBindServiceAsUser_Landroid_content_Intent_Landroid_content_ServiceConnection_ILandroid_os_UserHandle_Handler", ApiSince=30)>]
abstract member BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * int * Android.OS.UserHandle -> bool
override this.BindServiceAsUser : Android.Content.Intent * Android.Content.IServiceConnection * int * Android.OS.UserHandle -> bool

Parameter

service
Intent

Gibt den Dienst an, mit dem eine Verbindung hergestellt werden soll. Der Intent muss einen expliziten Komponentennamen angeben.

conn
IServiceConnection

Empfängt Informationen, während der Dienst gestartet und beendet wird. Dies muss ein gültiges ServiceConnection-Objekt sein; er darf nicht null sein.

flags
Int32

Vorgangsoptionen für die Bindung. Mai 0, #BIND_AUTO_CREATE, #BIND_DEBUG_UNBIND, #BIND_ABOVE_CLIENT#BIND_NOT_FOREGROUND, , #BIND_ALLOW_OOM_MANAGEMENT. #BIND_WAIVE_PRIORITY. #BIND_IMPORTANT oder #BIND_ADJUST_WITH_ACTIVITY.

user
UserHandle

Gibt zurück

true wenn sich das System im Prozess der Einrichtung eines Diensts befindet, an den Ihr Client über die Berechtigung zum Binden verfügt; false wenn das System den Dienst nicht finden konnte. Sie sollten die Verbindung auch dann freigeben #unbindService , wenn diese Methode zurückgegeben wurde false.

Attribute

Hinweise

Bindet auf dieselbe user Weise an einen Dienst wie #bindService.

Erfordert, dass eine der folgenden Bedingungen erfüllt ist: <ul><li>caller has /li>><caller has android.Manifest.permission.INTERACT_ACROSS_USERS_FULLandroid.Manifest.permission.INTERACT_ACROSS_USERS<and is the same package as the (determined by its service component's package) and the Android version is at least android.os.Build.VERSION_CODES#TIRAMISU</li li>><caller has android.Manifest.permission.INTERACT_ACROSS_USERS and is in same profile group as the given<user /li><>caller has android.Manifest.permission.INTERACT_ACROSS_PROFILES and is in same profile group as the given user and is in the same package as the service</li></ul>

Java Dokumentation für android.content.Context.bindServiceAsUser(android.content.Intent, android.content.ServiceConnection, int, android.os.UserHandle).

Teile dieser Seite sind Änderungen auf der Grundlage von Arbeiten, die von der Android Open Source Project erstellt und gemeinsam verwendet und gemäß den in der 2.5 Attribution License beschriebenen Begriffen verwendet werden.

Gilt für: