Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from hcoosthuizen/master
Browse files Browse the repository at this point in the history
Ensure toasts don't get queued up
  • Loading branch information
spacecowboy committed Aug 3, 2015
2 parents 7090da9 + e414ce5 commit 811f34d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public abstract class AbstractFilePickerFragment<T> extends Fragment
protected FileItemAdapter<T> mAdapter = null;
protected TextView mCurrentDirView;
protected SortedList<T> mFiles = null;
protected Toast mToast = null;

protected FileItemAdapter<T> getAdapter() {
return mAdapter;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 811f34d

Please sign in to comment.