...
Code Block | ||||
---|---|---|---|---|
| ||||
@Override
public void onClick(View view) {
if (mPublishButton.getTag() == null || Integer.valueOf(R.string.action_publish).equals(mPublishButton.getTag())) {
ActivityCompat.requestPermissions(ConferenceActivity.this,
new String[]{Manifest.permission.RECORD_AUDIO, Manifest.permission.CAMERA},
PUBLISH_REQUEST_CODE);
} else {
mPublishButton.setEnabled(false);
/**
* Stream is unpublished with method Room.unpublish().
*/
room.unpublish();
}
View currentFocus = getCurrentFocus();
if (currentFocus != null) {
InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}); |
12. Leaving chat room
Room.leave() code
Методу передается обработчик ответа REST-приложения WCS-сервераServer REST app response handler function is passed to the metod.
Code Block | ||||
---|---|---|---|---|
| ||||
room.leave(new RestAppCommunicator.Handler() { @Override public void onAccepted(Data data) { runOnUiThread(action); } @Override public void onRejected(Data data) { runOnUiThread(action); } }); |
...