{"action":"created","issue":{"url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/427","repository_url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper","labels_url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/427/labels{/name}","comments_url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/427/comments","events_url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/427/events","html_url":"https://github.com/CymChad/BaseRecyclerViewAdapterHelper/issues/427","id":184385621,"number":427,"title":"你好 需要频繁请求服务器数据 设置了handle消息 5秒请求一次 请求完数据调用哪个方法可以完成数据刷新","user":{"login":"zilingyao","id":16448548,"avatar_url":"https://avatars.githubusercontent.com/u/16448548?v=3","gravatar_id":"","url":"https://api.github.com/users/zilingyao","html_url":"https://github.com/zilingyao","followers_url":"https://api.github.com/users/zilingyao/followers","following_url":"https://api.github.com/users/zilingyao/following{/other_user}","gists_url":"https://api.github.com/users/zilingyao/gists{/gist_id}","starred_url":"https://api.github.com/users/zilingyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilingyao/subscriptions","organizations_url":"https://api.github.com/users/zilingyao/orgs","repos_url":"https://api.github.com/users/zilingyao/repos","events_url":"https://api.github.com/users/zilingyao/events{/privacy}","received_events_url":"https://api.github.com/users/zilingyao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-21T02:29:13Z","updated_at":"2016-10-21T03:27:15Z","closed_at":null,"body":"mQuickAdapter.notifyDataSetChanged(); 此方法并没有出现预期效果 没反应"},"comment":{"url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/comments/255285095","html_url":"https://github.com/CymChad/BaseRecyclerViewAdapterHelper/issues/427#issuecomment-255285095","issue_url":"https://api.github.com/repos/CymChad/BaseRecyclerViewAdapterHelper/issues/427","id":255285095,"user":{"login":"zilingyao","id":16448548,"avatar_url":"https://avatars.githubusercontent.com/u/16448548?v=3","gravatar_id":"","url":"https://api.github.com/users/zilingyao","html_url":"https://github.com/zilingyao","followers_url":"https://api.github.com/users/zilingyao/followers","following_url":"https://api.github.com/users/zilingyao/following{/other_user}","gists_url":"https://api.github.com/users/zilingyao/gists{/gist_id}","starred_url":"https://api.github.com/users/zilingyao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilingyao/subscriptions","organizations_url":"https://api.github.com/users/zilingyao/orgs","repos_url":"https://api.github.com/users/zilingyao/repos","events_url":"https://api.github.com/users/zilingyao/events{/privacy}","received_events_url":"https://api.github.com/users/zilingyao/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T03:27:15Z","updated_at":"2016-10-21T03:27:15Z","body":"我在网上查看是有这种说法 但是这个引用地址怎么看呢  全部代码\r\n    @Override\r\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\r\n        if (mView == null) {\r\n            mView = inflater.inflate(R.layout.fragment_path, container, false);\r\n        }\r\n        return mView;\r\n    }\r\n\r\n    @Override\r\n    public void onViewCreated(View view, Bundle savedInstanceState) {\r\n        super.onViewCreated(view, savedInstanceState);\r\n        EventBus.getDefault().register(getActivity());\r\n\r\n        mRecyclerView = (RecyclerView) mView.findViewById(R.id.rv_list1);\r\n        mSwipeRefreshLayout = (SwipeRefreshLayout) mView.findViewById(R.id.swipeLayout);\r\n        mSwipeRefreshLayout.setOnRefreshListener(this);\r\n        mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\r\n        int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.space);\r\n        mRecyclerView.addItemDecoration(new SpaceItemDecoration(spacingInPixels));\r\n        initAdapter();\r\n        mRecyclerView.setAdapter(mQuickAdapter);\r\n\r\n        Timer timer = new Timer();\r\n        timer.scheduleAtFixedRate(new MyTask(), 1, 3000);\r\n    }\r\n\r\n    //条目行间距\r\n    public class SpaceItemDecoration extends RecyclerView.ItemDecoration {\r\n\r\n        private int space;\r\n\r\n        public SpaceItemDecoration(int space) {\r\n            this.space = space;\r\n        }\r\n\r\n        @Override\r\n        public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {\r\n\r\n            if (parent.getChildPosition(view) != 0)\r\n                outRect.top = space;\r\n        }\r\n    }\r\n  \r\n    //初始化适配器\r\n    private void initAdapter() {\r\n        mQuickAdapter = new QuickPathAdapter(getdata());\r\n        mQuickAdapter.openLoadMore(PAGE_SIZE);\r\n        mRecyclerView.setAdapter(mQuickAdapter);\r\n\r\n        mRecyclerView.setHasFixedSize(true);\r\n        mCurrentCounter = mQuickAdapter.getData().size();\r\n        mQuickAdapter.setOnLoadMoreListener(this);\r\n\r\n\r\n        mRecyclerView.addOnItemTouchListener(new OnItemClickListener() {\r\n            @Override\r\n            public void SimpleOnItemClick(BaseQuickAdapter adapter, View view, int position) {\r\n\r\n            }\r\n\r\n            @Override\r\n            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {\r\n                super.onItemChildClick(adapter, view, position);\r\n                switch (view.getId()) {\r\n                    case R.id.ii_path_gotodetail:\r\n                        QuickPathBean quickPathBean = (QuickPathBean) adapter.getItem(position);\r\n                        Intent intent = new Intent(getActivity(), PathDetailActivity.class);\r\n                        intent.putExtra(\"quickPathBean\", quickPathBean);\r\n                        startActivity(intent);\r\n                        break;\r\n\r\n                    default:\r\n                        break;\r\n                }\r\n\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n    @Override\r\n    public void onRefresh() {\r\n        new Handler().postDelayed(new Runnable() {\r\n            @Override\r\n            public void run() {\r\n                mQuickAdapter.setNewData(getdata());\r\n                mQuickAdapter.openLoadMore(PAGE_SIZE);\r\n                mQuickAdapter.removeAllFooterView();\r\n                mCurrentCounter = PAGE_SIZE;\r\n                mSwipeRefreshLayout.setRefreshing(false);\r\n            }\r\n        }, delayMillis);\r\n\r\n    }\r\n\r\n    @Override\r\n    public void onLoadMoreRequested() {\r\n        mRecyclerView.post(new Runnable() {\r\n            @Override\r\n            public void run() {\r\n\r\n                if (mCurrentCounter >= TOTAL_COUNTER) { //加载完成\r\n                    mQuickAdapter.loadComplete();\r\n                    if (notLoadingView == null) {\r\n                        notLoadingView = getActivity().getLayoutInflater().inflate(R.layout.layout_empty, (ViewGroup) mRecyclerView.getParent(), false);\r\n                    }\r\n                    mQuickAdapter.removeAllFooterView();\r\n                    mQuickAdapter.addFooterView(notLoadingView);\r\n                } else {\r\n                    if (NetworkUtils.isAvailable(getActivity())) {\r\n                        new Handler().postDelayed(new Runnable() {\r\n                            @Override\r\n                            public void run() {\r\n                                //加载一页\r\n                                mQuickAdapter.addData(getdata());\r\n                                mCurrentCounter = mQuickAdapter.getData().size();\r\n                            }\r\n                        }, delayMillis);\r\n                    } else {\r\n                        Toast.makeText(getActivity(), \"网络错误\", Toast.LENGTH_LONG).show();\r\n                        mQuickAdapter.showLoadMoreFailedView();\r\n\r\n                    }\r\n                }\r\n            }\r\n\r\n        });\r\n\r\n    }\r\n\r\n    @Override\r\n    public void onDestroy() {\r\n        super.onDestroy();\r\n        EventBus.getDefault().unregister(getActivity());\r\n\r\n    }\r\n\r\n\r\n    private List<QuickPathBean> getdata(){\r\n\r\n        mPathBeanList = DataServer.getFragItemData(PAGE_SIZE);\r\n        return mPathBeanList;\r\n    }\r\n\r\n    private Handler mHandler = new Handler() {\r\n        public void handleMessage(Message msg)\r\n        {\r\n            switch (msg.what)\r\n            {\r\n                case 1:\r\n                    //添加数据\r\n                    mQuickAdapter.setNewData(getdata());\r\n                    //getdata();\r\n                    mQuickAdapter.notifyDataSetChanged();\r\n                    GLogger.gLog().e(\"呵呵\");\r\n                    break;\r\n            }\r\n        };\r\n    };\r\n\r\n    private class MyTask extends TimerTask {\r\n        @Override\r\n        public void run() {\r\n            Message message = new Message();\r\n            message.what = 1;\r\n            mHandler.sendMessage(message);\r\n        }\r\n\r\n    }"}}
{"actor":{"display_login":"zilingyao"}}