{"action":"created","issue":{"url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/168","repository_url":"https://api.github.com/repos/PaoloRotolo/AppIntro","labels_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/168/comments","events_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/168/events","html_url":"https://github.com/PaoloRotolo/AppIntro/issues/168","id":131608525,"number":168,"title":"Adding slide after init","user":{"login":"DHM47","id":6565963,"avatar_url":"https://avatars.githubusercontent.com/u/6565963?v=3","gravatar_id":"","url":"https://api.github.com/users/DHM47","html_url":"https://github.com/DHM47","followers_url":"https://api.github.com/users/DHM47/followers","following_url":"https://api.github.com/users/DHM47/following{/other_user}","gists_url":"https://api.github.com/users/DHM47/gists{/gist_id}","starred_url":"https://api.github.com/users/DHM47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DHM47/subscriptions","organizations_url":"https://api.github.com/users/DHM47/orgs","repos_url":"https://api.github.com/users/DHM47/repos","events_url":"https://api.github.com/users/DHM47/events{/privacy}","received_events_url":"https://api.github.com/users/DHM47/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-05T10:36:54Z","updated_at":"2016-03-18T19:30:35Z","closed_at":null,"body":"In my app I'm using this library as Introduction/tutorial.\r\nIn one case the user is presented with two options, what he selects will determine  what the next slides will be.\r\nFor now I'm using reflection in order to do that, because the page indicator and next/done button are not updated. \r\n\r\nThis is what I'm using\r\n`private void updateSlideNumber(int slidesNumber){\r\n        try {\r\n            final Class<?> clazz = AppIntro.class;\r\n\r\n            //Update \"slidesNumber\" so Next/Done behaves correctly\r\n            final Field field = clazz.getDeclaredField(\"slidesNumber\");\r\n            field.setAccessible(true);\r\n            field.set(getActivity(),slidesNumber);\r\n\r\n            //Remove the old page indicator\r\n            FrameLayout indicatorContainer = (FrameLayout) getActivity().findViewById(com.github.paolorotolo.appintro.R.id.indicator_container);\r\n            indicatorContainer.removeAllViews();\r\n\r\n            //Add new page indicator which represents the new amount of slides \r\n            Method method = clazz.getDeclaredMethod(\"initController\");\r\n            method.setAccessible(true);\r\n            method.invoke(getActivity());\r\n\r\n        } catch (final Exception ignored) {}\r\n    }`"},"comment":{"url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/comments/198510686","html_url":"https://github.com/PaoloRotolo/AppIntro/issues/168#issuecomment-198510686","issue_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/168","id":198510686,"user":{"login":"mveroukis","id":7936453,"avatar_url":"https://avatars.githubusercontent.com/u/7936453?v=3","gravatar_id":"","url":"https://api.github.com/users/mveroukis","html_url":"https://github.com/mveroukis","followers_url":"https://api.github.com/users/mveroukis/followers","following_url":"https://api.github.com/users/mveroukis/following{/other_user}","gists_url":"https://api.github.com/users/mveroukis/gists{/gist_id}","starred_url":"https://api.github.com/users/mveroukis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mveroukis/subscriptions","organizations_url":"https://api.github.com/users/mveroukis/orgs","repos_url":"https://api.github.com/users/mveroukis/repos","events_url":"https://api.github.com/users/mveroukis/events{/privacy}","received_events_url":"https://api.github.com/users/mveroukis/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T19:30:35Z","updated_at":"2016-03-18T19:30:35Z","body":"I see, slideNumber is protected, so I can bump that number after I call addSlide() from a derived class. Perhaps even better would be to override addSlide() and have it bump the number whenever a slide is added."}}