check if at least one account is set up, before receiving files

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-04-08 08:13:01 +02:00
parent 2ae9b70c49
commit 3b13c7156a
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -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();
}