Skip to content

Commit

Permalink
Improve the sample code.
Browse files Browse the repository at this point in the history
  • Loading branch information
codezjx committed Oct 21, 2021
1 parent 479f724 commit 8e8f35a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_binding);
ButterKnife.bind(this);

AndLinker.enableLogger(true);
mLinker = new AndLinker.Builder(this)
.packageName(REMOTE_SERVICE_PKG)
.action(REMOTE_SERVICE_ACTION)
Expand All @@ -61,6 +62,8 @@ public void onBind() {
@Override
public void onUnBind() {
Log.d(TAG, "AndLinker onUnBind()");
mRemoteService = null;
mRemoteTask = null;
}

@OnClick({R.id.btn_pid, R.id.btn_basic_types, R.id.btn_call_adapter, R.id.btn_rxjava2_call_adapter,
Expand Down Expand Up @@ -127,9 +130,9 @@ public void onFailure(Call<Integer> call, Throwable t) {
@Override
protected void onDestroy() {
super.onDestroy();
mLinker.setBindCallback(null);
mLinker.unRegisterObject(mRemoteCallback);
mLinker.unbind();
mLinker.setBindCallback(null);
}

private final IRemoteCallback mRemoteCallback = new IRemoteCallback() {
Expand Down

0 comments on commit 8e8f35a

Please sign in to comment.