| | |
| | | import android.os.IBinder; |
| | | import android.os.RemoteException; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | |
| | | import java.util.LinkedList; |
| | |
| | | @Override |
| | | public void binderDied() { |
| | | MyLog.e(TAG,"IBinder.DeathRecipient binderDied"); |
| | | if (remoteInterface != null){ |
| | | MyLog.e(TAG,"IBinder.DeathRecipient binderDied remoteInterface != null ,return"); |
| | | if (remoteInterface == null){ |
| | | MyLog.e(TAG,"IBinder.DeathRecipient binderDied remoteInterface == null ,return"); |
| | | return; |
| | | } |
| | | remoteInterface.asBinder().unlinkToDeath(mDeathRecipient,0); |
| | |
| | | try { |
| | | //设置死亡代理 |
| | | service.linkToDeath(mDeathRecipient,0); |
| | | |
| | | MyLog.i("绑定服务onServiceConnected"); |
| | | remoteInterface.registListener(RemoteCallback); |
| | | } catch (RemoteException e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | @Override |
| | | public void onServiceDisconnected(ComponentName name) { |
| | | |
| | | MyLog.i("绑定服务失败onServiceDisconnected"); |
| | | } |
| | | |
| | | |