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);

View File

@ -17,6 +17,7 @@
<string name="copy">Copia</string>
<string name="share">Condividi</string>
<string name="shared_files">Files shared via Simple File Manager</string>
<string name="no_files_selected">No files selected</string>
<string name="copy_item">Copia elemento</string>
<string name="copy_items">Copia elementi</string>
<string name="move">Sposta</string>

View File

@ -17,6 +17,7 @@
<string name="copy">コピー</string>
<string name="share">Dela</string>
<string name="shared_files">Files shared via Simple File Manager</string>
<string name="no_files_selected">No files selected</string>
<string name="copy_item">アイテムをコピー</string>
<string name="copy_items">アイテムをコピー</string>
<string name="move">移動</string>

View File

@ -17,6 +17,7 @@
<string name="copy">Kopiera</string>
<string name="share">Dela</string>
<string name="shared_files">Files shared via Simple File Manager</string>
<string name="no_files_selected">No files selected</string>
<string name="copy_item">Kopiera objekt</string>
<string name="copy_items">Kopiera objekt</string>
<string name="move">Flytta</string>

View File

@ -17,6 +17,7 @@
<string name="copy">Copy</string>
<string name="share">Share</string>
<string name="shared_files">Files shared via Simple File Manager</string>
<string name="no_files_selected">No files selected</string>
<string name="copy_item">Copy item</string>
<string name="copy_items">Copy items</string>
<string name="move">Move</string>