Prevent crash from toolbar subtitle in call view.
This commit is contained in:
parent
dd62d92ffb
commit
69c1c856d9
1 changed files with 9 additions and 1 deletions
|
@ -600,7 +600,15 @@ public class WebRtcCallView extends ConstraintLayout {
|
|||
public void setStatus(@Nullable String status) {
|
||||
ThreadUtil.assertMainThread();
|
||||
this.status.setText(status);
|
||||
collapsedToolbar.setSubtitle(status);
|
||||
try {
|
||||
// Toolbar's subtitle view sometimes already has a parent somehow,
|
||||
// so we clear it out first so that it removes the view from its parent.
|
||||
// In addition, we catch the ISE to prevent a crash.
|
||||
collapsedToolbar.setSubtitle(null);
|
||||
collapsedToolbar.setSubtitle(status);
|
||||
} catch (IllegalStateException e) {
|
||||
Log.w(TAG, "IllegalStateException trying to set status on collapsed Toolbar.");
|
||||
}
|
||||
}
|
||||
|
||||
private void setStatus(@StringRes int statusRes) {
|
||||
|
|
Loading…
Add table
Reference in a new issue