diff --git a/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java b/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java index a7d8fcdb6e..5b0bb40941 100644 --- a/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ConflictsResolveActivity.java @@ -46,8 +46,7 @@ import androidx.fragment.app.FragmentTransaction; /** - * Wrapper activity which will be launched if keep-in-sync file will be modified by external - * application. + * Wrapper activity which will be launched if keep-in-sync file will be modified by external application. */ public class ConflictsResolveActivity extends FileActivity implements OnConflictDecisionMadeListener { /** @@ -226,7 +225,7 @@ public class ConflictsResolveActivity extends FileActivity implements OnConflict } private void showErrorAndFinish() { - Toast.makeText(this, R.string.conflict_dialog_error, Toast.LENGTH_LONG).show(); + runOnUiThread(() -> Toast.makeText(this, R.string.conflict_dialog_error, Toast.LENGTH_LONG).show()); finish(); } diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java b/src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java index dd2b2bfb4a..467835cc85 100644 --- a/src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java +++ b/src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java @@ -214,13 +214,16 @@ public class PreviewTextFileFragment extends PreviewTextFragment { if (textView != null) { mOriginalText = stringWriter.toString(); - mSearchView.setOnQueryTextListener(PreviewTextFileFragment.this); - setText(textView, mOriginalText, getFile(), requireActivity()); - if (mSearchOpen) { - mSearchView.setQuery(mSearchQuery, true); + if (mSearchView != null) { + mSearchView.setOnQueryTextListener(PreviewTextFileFragment.this); + + if (mSearchOpen) { + mSearchView.setQuery(mSearchQuery, true); + } } + textView.setVisibility(View.VISIBLE); }