去除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

@ -37,7 +37,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import androidx.annotation.NonNull;
import androidx.lifecycle.Lifecycle;
import butterknife.ButterKnife;
import static com.gh.common.util.EntranceUtils.KEY_ENTRANCE;
@ -126,13 +126,11 @@ public abstract class BaseActivity extends BaseToolBarActivity {
}
public void toast(String msg) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
Utils.toast(this, msg);
Utils.toast(this, msg);
}
public void toast(int msg) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
toast(getString(msg));
toast(getString(msg));
}
public void showShare(String url, String icon, String shareTitle, String shareSummary, ShareUtils.ShareType shareType) {
@ -207,7 +205,7 @@ public abstract class BaseActivity extends BaseToolBarActivity {
/**
* @param entrance 上一个页面的链式入口名称
* @param path 当前页面名称
* @param path 当前页面名称
* @return 完整的链式入口名称
*/
public static String mergeEntranceAndPath(String entrance, String path) {