mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
fixed bug caused by rotating the device
This commit is contained in:
parent
fafc422ca4
commit
be5dbcbb2e
1 changed files with 14 additions and 5 deletions
|
@ -202,11 +202,20 @@ public class PreviewTextFragment extends FileFragment {
|
|||
* Show loading dialog
|
||||
*/
|
||||
public void showLoadingDialog() {
|
||||
// Construct dialog
|
||||
LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
|
||||
FragmentManager fm = getActivity().getSupportFragmentManager();
|
||||
FragmentTransaction ft = fm.beginTransaction();
|
||||
loading.show(ft, DIALOG_WAIT_TAG);
|
||||
// only once
|
||||
Fragment frag = getActivity().getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
|
||||
LoadingDialog loading = null;
|
||||
if (frag == null) {
|
||||
// Construct dialog
|
||||
loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment));
|
||||
FragmentManager fm = getActivity().getSupportFragmentManager();
|
||||
FragmentTransaction ft = fm.beginTransaction();
|
||||
loading.show(ft, DIALOG_WAIT_TAG);
|
||||
} else {
|
||||
loading = (LoadingDialog) frag;
|
||||
loading.setShowsDialog(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue