From 1b8227a723ee1ddfd7f6fa9cfa740b734ca125fc Mon Sep 17 00:00:00 2001 From: codezjx Date: Fri, 4 Aug 2023 10:03:08 +0800 Subject: [PATCH] Move fireOnBind() method after register callback, make sure the inner callback can be called correctly --- andlinker/src/main/java/com/codezjx/andlinker/AndLinker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/andlinker/src/main/java/com/codezjx/andlinker/AndLinker.java b/andlinker/src/main/java/com/codezjx/andlinker/AndLinker.java index 358e0f3..c98b3e4 100644 --- a/andlinker/src/main/java/com/codezjx/andlinker/AndLinker.java +++ b/andlinker/src/main/java/com/codezjx/andlinker/AndLinker.java @@ -155,12 +155,12 @@ private ServiceConnection createServiceConnection() { public void onServiceConnected(ComponentName name, IBinder service) { Logger.d(TAG, "onServiceConnected:" + name + " service:" + service); mTransferService = ITransfer.Stub.asInterface(service); - fireOnBind(); try { mTransferService.register(mCallback); } catch (RemoteException e) { e.printStackTrace(); } + fireOnBind(); } @Override