{"action":"opened","issue":{"url":"https://api.github.com/repos/Jude95/SwipeBackHelper/issues/8","labels_url":"https://api.github.com/repos/Jude95/SwipeBackHelper/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/Jude95/SwipeBackHelper/issues/8/comments","events_url":"https://api.github.com/repos/Jude95/SwipeBackHelper/issues/8/events","html_url":"https://github.com/Jude95/SwipeBackHelper/issues/8","id":116045027,"number":8,"title":"请教一下，与SwipeRefreshLayout搭配会报异常，但是不影响，是什么原因？","user":{"login":"wudashan","id":5417695,"avatar_url":"https://avatars.githubusercontent.com/u/5417695?v=3","gravatar_id":"","url":"https://api.github.com/users/wudashan","html_url":"https://github.com/wudashan","followers_url":"https://api.github.com/users/wudashan/followers","following_url":"https://api.github.com/users/wudashan/following{/other_user}","gists_url":"https://api.github.com/users/wudashan/gists{/gist_id}","starred_url":"https://api.github.com/users/wudashan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wudashan/subscriptions","organizations_url":"https://api.github.com/users/wudashan/orgs","repos_url":"https://api.github.com/users/wudashan/repos","events_url":"https://api.github.com/users/wudashan/events{/privacy}","received_events_url":"https://api.github.com/users/wudashan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-10T06:54:28Z","updated_at":"2015-11-10T06:54:28Z","closed_at":null,"body":"```\r\npackage com.example.administrator.myapplication;\r\n\r\nimport android.os.Bundle;\r\nimport android.os.Handler;\r\nimport android.support.v4.widget.SwipeRefreshLayout;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.support.v7.widget.Toolbar;\r\nimport android.view.Menu;\r\nimport android.view.MenuItem;\r\n\r\nimport com.jude.swipbackhelper.SwipeBackHelper;\r\n\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n    private SwipeRefreshLayout mSwipeRefreshLayout;\r\n    private Handler mHandler;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n        SwipeBackHelper.onCreate(this);\r\n        mHandler = new Handler();\r\n\r\n\r\n        mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.mSwipeRefreshLayout);\r\n        mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright);\r\n        mSwipeRefreshLayout.setProgressViewOffset(false,300,500);\r\n        mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {\r\n            @Override\r\n            public void onRefresh() {\r\n                mSwipeRefreshLayout.setRefreshing(true);\r\n\r\n                new Thread(new Runnable() {\r\n                    @Override\r\n                    public void run() {\r\n                        try {\r\n                            Thread.sleep(1000);\r\n                            mHandler.post(new Runnable() {\r\n                                @Override\r\n                                public void run() {\r\n                                    mSwipeRefreshLayout.setRefreshing(false);\r\n                                }\r\n                            });\r\n                        } catch (InterruptedException e) {\r\n                            e.printStackTrace();\r\n                        }\r\n\r\n                    }\r\n                }).start();\r\n            }\r\n        });\r\n\r\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\r\n        setSupportActionBar(toolbar);\r\n\r\n\r\n    }\r\n\r\n    @Override\r\n    public boolean onCreateOptionsMenu(Menu menu) {\r\n        // Inflate the menu; this adds items to the action bar if it is present.\r\n        getMenuInflater().inflate(R.menu.menu_main, menu);\r\n        return true;\r\n    }\r\n\r\n    @Override\r\n    public boolean onOptionsItemSelected(MenuItem item) {\r\n        // Handle action bar item clicks here. The action bar will\r\n        // automatically handle clicks on the Home/Up button, so long\r\n        // as you specify a parent activity in AndroidManifest.xml.\r\n        int id = item.getItemId();\r\n\r\n        //noinspection SimplifiableIfStatement\r\n        if (id == R.id.action_settings) {\r\n            return true;\r\n        }\r\n\r\n        return super.onOptionsItemSelected(item);\r\n    }\r\n\r\n    @Override\r\n    protected void onPostCreate(Bundle savedInstanceState) {\r\n        super.onPostCreate(savedInstanceState);\r\n        SwipeBackHelper.onPostCreate(this);\r\n    }\r\n\r\n    @Override\r\n    protected void onDestroy() {\r\n        super.onDestroy();\r\n        SwipeBackHelper.onDestroy(this);\r\n    }\r\n}\r\n```"}}