Fix a crash that can happen sometimes
This commit is contained in:
parent
56be852dca
commit
6fe7d87ac4
1 changed files with 9 additions and 6 deletions
|
@ -952,12 +952,16 @@ public class ChatMessagesFragment extends Fragment
|
||||||
/** File transfer related */
|
/** File transfer related */
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
String files[] = new String[mFilesUploadLayout.getChildCount()];
|
if (mFilesUploadLayout != null) {
|
||||||
for (int i = 0; i < mFilesUploadLayout.getChildCount(); i++) {
|
String files[] = new String[mFilesUploadLayout.getChildCount()];
|
||||||
View child = mFilesUploadLayout.getChildAt(i);
|
for (int i = 0; i < mFilesUploadLayout.getChildCount(); i++) {
|
||||||
String path = (String) child.getTag();
|
View child = mFilesUploadLayout.getChildAt(i);
|
||||||
files[i] = path;
|
String path = (String) child.getTag();
|
||||||
|
files[i] = path;
|
||||||
|
}
|
||||||
|
outState.putStringArray("Files", files);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCurrentInputContentInfo != null) {
|
if (mCurrentInputContentInfo != null) {
|
||||||
outState.putParcelable(
|
outState.putParcelable(
|
||||||
INPUT_CONTENT_INFO_KEY, (Parcelable) mCurrentInputContentInfo.unwrap());
|
INPUT_CONTENT_INFO_KEY, (Parcelable) mCurrentInputContentInfo.unwrap());
|
||||||
|
@ -965,7 +969,6 @@ public class ChatMessagesFragment extends Fragment
|
||||||
}
|
}
|
||||||
mCurrentInputContentInfo = null;
|
mCurrentInputContentInfo = null;
|
||||||
mCurrentFlags = 0;
|
mCurrentFlags = 0;
|
||||||
outState.putStringArray("Files", files);
|
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue