Package com.zopim.android.sdk.api
Class ChatServiceBinder
- java.lang.Object
-
- Fragment
-
- com.zopim.android.sdk.api.ChatServiceBinder
-
public final class ChatServiceBinder extends Fragment
Takes care of the chat service bind/unbind from the host activity that started the chat. Provides a default behaviour to attach withActivity#onStart()
and detach withActivity#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()
andActivity#onPause()
as the service might not be connected outside of that state and the instance of chat won't be able to communicate.
-
-
Constructor Summary
Constructors Constructor and Description ChatServiceBinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
onCreate(Bundle savedInstanceState)
void
onStart()
Bind on start to assure that activity has service connection while visible Chat service will bounded and ready to use inActivity#onPause()
.void
onStop()
Unbinding on stop to assure we don't leak service connection to the activity after the chat has ended.
-
-
-
Method Detail
-
onCreate
public void onCreate(Bundle savedInstanceState)
-
onStart
public void onStart()
Bind on start to assure that activity has service connection while visible Chat service will bounded and ready to use inActivity#onPause()
. Note: pre appcompat-v7 23.2.x chat service will be bounded even inActivity#onStart()
-
onStop
public void onStop()
Unbinding on stop to assure we don't leak service connection to the activity after the chat has ended. Chat service will unbounded afterActivity#onStop()
. All of the chat operations should finish before inActivity#onPause()
-
-