ChatSession

public class ChatSession extends AppCompatActivity

Chat session activity. Represents a chat session between 2 users.

Fields

EXTRA_FRIEND_ID

public static final String EXTRA_FRIEND_ID

Intent extra field: Friend user id

EXTRA_FRIEND_NAME

public static final String EXTRA_FRIEND_NAME

Intent extra field: Friend name

Methods

addResponse

public void addResponse(String message, String userId)

Adds an user response to the chat log

Parameters:
  • message – Message to add
  • userId – Sender id

onCreate

protected void onCreate(Bundle bundle)

Perform initialization of all fragments and loaders.

Parameters:
  • bundle – If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). Note: Otherwise it is null.

onStart

protected void onStart()

Called after onCreate(Bundle) — or after onRestart() when the activity had been stopped, but is now again being displayed to the user. It will be followed by onResume().

Derived classes must call through to the super class’s implementation of this method. If they do not, an exception will be thrown.

onStop

public void onStop()

Called when you are no longer visible to the user. You will next receive either onRestart(), onDestroy(), or nothing, depending on later user activity.

Derived classes must call through to the super class’s implementation of this method. If they do not, an exception will be thrown.