diff --git a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java index f3be5593..6f7ef873 100644 --- a/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java +++ b/library/src/main/java/com/nononsenseapps/filepicker/AbstractFilePickerFragment.java @@ -79,6 +79,7 @@ public abstract class AbstractFilePickerFragment extends Fragment protected FileItemAdapter mAdapter = null; protected TextView mCurrentDirView; protected SortedList mFiles = null; + protected Toast mToast = null; protected FileItemAdapter getAdapter() { return mAdapter; @@ -162,9 +163,11 @@ public void onClick(final View v) { // Some invalid cases first if ((allowMultiple || mode == MODE_FILE) && mCheckedItems.isEmpty()) { - Toast.makeText(getActivity(), - R.string.nnf_select_something_first, - Toast.LENGTH_SHORT).show(); + if (mToast == null) { + mToast = Toast.makeText(getActivity(), R.string.nnf_select_something_first, + Toast.LENGTH_SHORT); + } + mToast.show(); return; }