public static class ZopimChatApi.ChatServiceBinder extends Fragment
Activity.onStart()
and detach with Activity.onStop()
.
Orientation change will unbind a service from destroyed activity and then it will bind again to the recreated activity. Minimizing the chat will unbind the activity and it will be re-bound when resumed.
All chat communications should be done between Activity.onResume()
and Activity.onPause()
as the service might not be connected outside of that state and the instance of chat won't be able to communicate.
Fragment.InstantiationException, Fragment.SavedState
Constructor and Description |
---|
ChatServiceBinder() |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
boolean |
isBound() |
void |
onAttach(Activity activity) |
void |
onDestroy() |
void |
onDetach() |
void |
onPause() |
void |
onResume() |
void |
onStart()
Bind on start to assure that activity has service connection while visible
Chat service will bounded and ready to use in
Activity.onPause() . |
void |
onStop()
Unbinding on stop to assure we don't leak service connection to the activity after the chat has ended.
|
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isVisible, onActivityCreated, onActivityResult, onAttach, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroyOptionsMenu, onDestroyView, onHiddenChanged, onInflate, onInflate, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPrepareOptionsMenu, onRequestPermissionsResult, onSaveInstanceState, onViewCreated, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, toString, unregisterForContextMenu
public boolean isBound()
public void onStart()
Activity.onPause()
.
Note: pre appcompat-v7 23.2.x chat service will be bounded even in Activity.onStart()
public void onStop()
Activity.onStop()
. All of the chat operations should finish before in Activity.onPause()