@Override public void onDestroy() { super.onDestroy(); if (isServiceConnected(RcsServiceName.CAPABILITY)) { // Remove image sharing listener try { getCapabilityApi().removeCapabilitiesListener(mCapabilitiesListener); } catch (RcsServiceException e) { Log.w(LOGTAG, ExceptionUtil.getFullStackTrace(e)); } } }