FILE: /Users/Hades/Hades/Study/PHP/WebSites/av/ThinkPHP/Library/Think/Db/Driver.class.php LINE: 117
如图:
解决方案:
我没搞清楚原理,
我将 /application/common/con/config.php配置文件中的 Localhsot 修改成了127.0.0.1
就OK了!
- Set a hint to the system about whether this fragment's UI is currently visible to the user. This hint defaults to true and is persistent across fragment instance state save and restore.
- An app may set this to false to indicate that the fragment's UI is scrolled out of visibility or is otherwise not directly visible to the user. This may be used by the system to prioritize operations such as fragment lifecycle updates or loader ordering behavior.
- Parameters
- isVisibleToUser true if this fragment's UI is currently visible to the user (default), false if it is not.
- /*
- * Date: 14-7-17
- * Project: Access-Control-V2
- */
- package cn.irains.access_control_v2.common;
- import android.support.v4.app.Fragment;
- /**
- * Author: msdx (645079761@qq.com)
- * Time: 14-7-17 下午5:46
- */
- public abstract class LazyFragment extends Fragment {
- protected boolean isVisible;
- /**
- * 在这里实现Fragment数据的缓加载.
- * @param isVisibleToUser
- */
- @Override
- public void setUserVisibleHint(boolean isVisibleToUser) {
- super.setUserVisibleHint(isVisibleToUser);
- if(getUserVisibleHint()) {
- isVisible = true;
- onVisible();
- } else {
- isVisible = false;
- onInvisible();
- }
- }
- protected void onVisible(){
- lazyLoad();
- }
- protected abstract void lazyLoad();
- protected void onInvisible(){}
- }
- public class OpenResultFragment extends LazyFragment{
- // 标志位,标志已经初始化完成。
- private boolean isPrepared;
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- Log.d(LOG_TAG, "onCreateView");
- View view = inflater.inflate(R.layout.fragment_open_result, container, false);
- //XXX初始化view的各控件
- isPrepared = true;
- lazyLoad();
- return view;
- }
- @Override
- protected void lazyLoad() {
- if(!isPrepared || !isVisible) {
- return;
- }
- //填充各控件的数据
- }
- }