去除toast生命周期限制

This commit is contained in:
kehaoyuan
2019-10-21 22:16:52 +08:00
parent 1065abcd44
commit 4e06147b82
2 changed files with 6 additions and 10 deletions

View File

@ -181,13 +181,11 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
}
public void toast(@StringRes int res) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
toast(getString(res));
toast(getString(res));
}
public void toast(String msg) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
Utils.toast(getContext(), msg);
Utils.toast(getContext(), msg);
}
public void toastLong(@StringRes int msg) {