From 3b13c7156a29d8f1f3839062860a569ab4345fb5 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 8 Apr 2020 08:13:01 +0200 Subject: [PATCH] check if at least one account is set up, before receiving files Signed-off-by: tobiasKaminsky --- .../ui/activity/ReceiveExternalFilesActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java b/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java index 0fedc9d49e..67327d177b 100755 --- a/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java @@ -63,6 +63,7 @@ import android.widget.ListView; import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.TextView; +import android.widget.Toast; import com.google.android.material.button.MaterialButton; import com.nextcloud.client.di.Injectable; @@ -238,6 +239,15 @@ public class ReceiveExternalFilesActivity extends FileActivity @Override protected void onStart() { super.onStart(); + + if (mAccountManager.getAccountsByType(MainApp.getAccountType(this)).length == 0) { + Toast.makeText(this, + String.format(getString(R.string.uploader_wrn_no_account_text), + getString(R.string.app_name)), + Toast.LENGTH_LONG).show(); + return; + } + initTargetFolder(); populateDirectoryList(); }