prevent launching an empty Share intent

This commit is contained in:
tibbi
2016-08-22 22:39:37 +02:00
parent 86cdd270d9
commit a4d58e1157
5 changed files with 9 additions and 0 deletions

View File

@ -346,6 +346,11 @@ public class ItemsFragment extends android.support.v4.app.Fragment
uris.add(Uri.fromFile(file));
}
if (uris.isEmpty()) {
Utils.showToast(getContext(), R.string.no_files_selected);
return;
}
final String shareTitle = getResources().getString(R.string.share_via);
final Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND_MULTIPLE);