{"action":"created","issue":{"url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/34","repository_url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder","labels_url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/34/comments","events_url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/34/events","html_url":"https://github.com/klinker24/Android-TextView-LinkBuilder/issues/34","id":152459062,"number":34,"title":"Help: I couldn't use it","user":{"login":"ozuf","id":18336192,"avatar_url":"https://avatars.githubusercontent.com/u/18336192?v=3","gravatar_id":"","url":"https://api.github.com/users/ozuf","html_url":"https://github.com/ozuf","followers_url":"https://api.github.com/users/ozuf/followers","following_url":"https://api.github.com/users/ozuf/following{/other_user}","gists_url":"https://api.github.com/users/ozuf/gists{/gist_id}","starred_url":"https://api.github.com/users/ozuf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozuf/subscriptions","organizations_url":"https://api.github.com/users/ozuf/orgs","repos_url":"https://api.github.com/users/ozuf/repos","events_url":"https://api.github.com/users/ozuf/events{/privacy}","received_events_url":"https://api.github.com/users/ozuf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-01T22:29:45Z","updated_at":"2016-05-03T01:24:56Z","closed_at":"2016-05-01T22:42:17Z","body":"Please I'm finding it difficult to use. Please can you help me out? \r\n\r\n**My Activity**\r\n                          \r\n\r\n\r\n        public class PostDetails extends AppCompatActivity {\r\n    \r\n        private final String TAG = \"PostDetails\";\r\n        private AlertDialog internetDialog;\r\n        private AlertDialog sthWrongAlert;\r\n    \r\n        private String postData;\r\n    \r\n        protected com.nostra13.universalimageloader.core.ImageLoader mImageLoader;\r\n    \r\n    \r\n        TextView postTitle, postContent;\r\n        private String post_content;\r\n    \r\n    \r\n        @Override\r\n        protected void onCreate(Bundle savedInstanceState) {\r\n            super.onCreate(savedInstanceState);\r\n            setContentView(R.layout.activity_post_details);\r\n    \r\n            showDialog();\r\n            sthWrongDialog();\r\n    \r\n            postTitle = (TextView) findViewById(R.id.dpost_title);\r\n            postContent = (TextView) findViewById(R.id.dpost_content);\r\n            postContent.setMovementMethod(LinkMovementMethod.getInstance());\r\n    \r\n    \r\n            Link link = new Link(Regex.WEB_URL_PATTERN)\r\n                    .setTextColor(Color.GREEN)\r\n                    .setHighlightAlpha(.4f)\r\n                    .setUnderlined(false)\r\n                    .setBold(true)\r\n                    .setOnClickListener(new Link.OnClickListener() {\r\n                        @Override\r\n                        public void onClick(String clickedText) {\r\n                            Toast.makeText(PostDetails.this, \"Link clicked is :: \" + clickedText, Toast.LENGTH_SHORT).show();\r\n                            finish();\r\n                        }\r\n                    });\r\n    \r\n            LinkBuilder.on(postContent)\r\n                    .addLink(link)\r\n                    .build();\r\n    \r\n            DisplayImageOptions defaultoptions = new DisplayImageOptions.Builder()\r\n                    .cacheInMemory(true)\r\n                    .cacheOnDisk(true)\r\n                    .build();\r\n            ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())\r\n                    .defaultDisplayImageOptions(defaultoptions)\r\n                    .writeDebugLogs()\r\n                    .build();\r\n    \r\n            mImageLoader = com.nostra13.universalimageloader.core.ImageLoader.getInstance();\r\n            mImageLoader.init(config);\r\n            \r\n            loadPost();\r\n        }\r\n        \r\n        private void showDialog() {\r\n            internetDialog = new AlertDialog.Builder(PostDetails.this)\r\n                   ...\r\n        }\r\n    \r\n        private void sthWrongDialog() {\r\n            sthWrongAlert = new AlertDialog.Builder(PostDetails.this)\r\n                   ...\r\n        }\r\n    \r\n        private void loadPost() {\r\n            Log.d(TAG, \"loadPost called\");\r\n    \r\n            final ProgressBar progressBar;\r\n            progressBar = (ProgressBar) findViewById(R.id.progress_circle);\r\n            progressBar.setVisibility(View.VISIBLE);\r\n    \r\n    \r\n            String news_id = getIntent().getStringExtra(\"PostId\");\r\n            Log.d(TAG, \"You clicked post id \" + news_id);\r\n    \r\n            StringRequest stringRequest = new StringRequest(news_id,\r\n                    new Response.Listener<String>() {\r\n                        @Override\r\n                        public void onResponse(String response) {\r\n                            //Log.d(\"Debug\", response.toString());\r\n                            if (progressBar != null) {\r\n                                progressBar.setVisibility(View.GONE);\r\n                            }\r\n                            parseHtml(response);\r\n                            postData = response;\r\n                        }\r\n                    },\r\n                    new Response.ErrorListener() {\r\n                        @Override\r\n                        public void onErrorResponse(VolleyError error) {\r\n                            VolleyLog.d(TAG, \"Error: \" + error.getMessage());\r\n    \r\n                            if (progressBar != null) {\r\n                                progressBar.setVisibility(View.GONE);\r\n                            }\r\n                            sthWrongAlert.show();\r\n                        }\r\n                    });\r\n    \r\n            //Creating requestqueue\r\n            RequestQueue requestQueue = Volley.newRequestQueue(this);\r\n    \r\n            //Adding request queue\r\n            requestQueue.add(stringRequest);\r\n        }\r\n    \r\n        private void parseHtml(String response) {\r\n            Log.d(TAG, \"parsinghtml\");\r\n            Document document = Jsoup.parse(response);\r\n            String post_title = document.select(\"h1.entry-title\").first().text();\r\n            post_content = document.select(\"div.entry-content\").first().html();\r\n    \r\n            postTitle.setText(post_title);\r\n           \r\n            Spanned spanned = Html.fromHtml(post_content, new UILImageGetter(postContent, this), null );\r\n            postContent.setText(spanned);\r\n    \r\n            //Unhiding views\r\n            postTitle.setVisibility(View.VISIBLE);\r\n            postContent.setVisibility(View.VISIBLE);\r\n        }\r\n    \r\n    \r\n        ...\r\n    }\r\n\r\nWhen I click on a link, it's supposed to close this activity and show a toast but that ain't happening. Rather, clicking a link still fires the chooser to choose web browsers.\r\nPlease, what am I getting wrong?"},"comment":{"url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/comments/216411222","html_url":"https://github.com/klinker24/Android-TextView-LinkBuilder/issues/34#issuecomment-216411222","issue_url":"https://api.github.com/repos/klinker24/Android-TextView-LinkBuilder/issues/34","id":216411222,"user":{"login":"klinker24","id":4874287,"avatar_url":"https://avatars.githubusercontent.com/u/4874287?v=3","gravatar_id":"","url":"https://api.github.com/users/klinker24","html_url":"https://github.com/klinker24","followers_url":"https://api.github.com/users/klinker24/followers","following_url":"https://api.github.com/users/klinker24/following{/other_user}","gists_url":"https://api.github.com/users/klinker24/gists{/gist_id}","starred_url":"https://api.github.com/users/klinker24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klinker24/subscriptions","organizations_url":"https://api.github.com/users/klinker24/orgs","repos_url":"https://api.github.com/users/klinker24/repos","events_url":"https://api.github.com/users/klinker24/events{/privacy}","received_events_url":"https://api.github.com/users/klinker24/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T01:24:56Z","updated_at":"2016-05-03T01:24:56Z","body":"I think you should fork the project, add an example of what you are trying to do, then reopen the issue and tell me where I can find your fork. Then I will see if I can find what is going on."}}