Sprache

PccClient.CreateInstance(Context, IBinder) Method

Definition

Factory method to create an instance of PccClient.

[Android.Runtime.Register("createInstance", "(Landroid/content/Context;Landroid/os/IBinder;)Landroid/app/privatecompute/PccClient;", "", ApiSince=37)]
public static Android.App.PrivateCompute.PccClient CreateInstance(Android.Content.Context context, Android.OS.IBinder binder);
[<Android.Runtime.Register("createInstance", "(Landroid/content/Context;Landroid/os/IBinder;)Landroid/app/privatecompute/PccClient;", "", ApiSince=37)>]
static member CreateInstance : Android.Content.Context * Android.OS.IBinder -> Android.App.PrivateCompute.PccClient

Parameters

context
Context

The Context from the calling component.

binder
IBinder

The IBinder object received from the service connection.

Returns

A new instance of PccClient.

Attributes

Remarks

Factory method to create an instance of PccClient. This should be called from onServiceConnected() with the IBinder received from the system

private final ServiceConnection mConnection = new ServiceConnection() {
  @Override
  public void onServiceConnected(ComponentName className, IBinder service) {
    mClient = PccClient.createInstance(MainActivity.this, service);
  }

  @Override
  public void onServiceDisconnected(ComponentName className) {
    mClient = null;
  }
};

//...
bindService(intent, mConnection, flags);

Android reference for android.app.privatecompute.PccClient.createInstance.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to