Commit 7b7d619e4094d52b9aa0ddd13cdd490f23a35ed4
1 parent
a27f89e0
优化基类
Showing
1 changed file
with
0 additions
and
31 deletions
core/base/src/main/java/com/cnlive/core/libs/base/frame/activity/BaseActivity.java
| @@ -45,8 +45,6 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -45,8 +45,6 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 45 | private boolean isShowStatusBar = true; | 45 | private boolean isShowStatusBar = true; |
| 46 | //是否允许旋转屏幕 | 46 | //是否允许旋转屏幕 |
| 47 | private boolean isAllowScreenRoate = true; | 47 | private boolean isAllowScreenRoate = true; |
| 48 | - //封装Toast对象 | ||
| 49 | - private static Toast toast; | ||
| 50 | public Context context; | 48 | public Context context; |
| 51 | private int stateBarColor = -1; | 49 | private int stateBarColor = -1; |
| 52 | 50 | ||
| @@ -164,35 +162,6 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | @@ -164,35 +162,6 @@ public abstract class BaseActivity<V extends BaseView, P extends BasePresenter<V | ||
| 164 | } | 162 | } |
| 165 | 163 | ||
| 166 | /** | 164 | /** |
| 167 | - * 显示提示 toast | ||
| 168 | - * | ||
| 169 | - * @param msg 提示信息 | ||
| 170 | - */ | ||
| 171 | - @SuppressLint("ShowToast") | ||
| 172 | - public void showToast(String msg) { | ||
| 173 | - try { | ||
| 174 | - if (null == toast) { | ||
| 175 | - toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT); | ||
| 176 | - } else { | ||
| 177 | - toast.setText(msg); | ||
| 178 | - } | ||
| 179 | - runOnUiThread(new Runnable() { | ||
| 180 | - @Override | ||
| 181 | - public void run() { | ||
| 182 | - toast.show(); | ||
| 183 | - } | ||
| 184 | - }); | ||
| 185 | - } catch (Exception e) { | ||
| 186 | - e.printStackTrace(); | ||
| 187 | - //解决在子线程中调用Toast的异常情况处理 | ||
| 188 | - Looper.prepare(); | ||
| 189 | - Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); | ||
| 190 | - Looper.loop(); | ||
| 191 | - } | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - | ||
| 195 | - /** | ||
| 196 | * 隐藏软键盘 | 165 | * 隐藏软键盘 |
| 197 | */ | 166 | */ |
| 198 | public void hideSoftInput() { | 167 | public void hideSoftInput() { |