{"action":"created","issue":{"url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/245","repository_url":"https://api.github.com/repos/PaoloRotolo/AppIntro","labels_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/245/comments","events_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/245/events","html_url":"https://github.com/PaoloRotolo/AppIntro/issues/245","id":159300650,"number":245,"title":"Show the Intro Once Not working","user":{"login":"kennyung6","id":12512546,"avatar_url":"https://avatars.githubusercontent.com/u/12512546?v=3","gravatar_id":"","url":"https://api.github.com/users/kennyung6","html_url":"https://github.com/kennyung6","followers_url":"https://api.github.com/users/kennyung6/followers","following_url":"https://api.github.com/users/kennyung6/following{/other_user}","gists_url":"https://api.github.com/users/kennyung6/gists{/gist_id}","starred_url":"https://api.github.com/users/kennyung6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennyung6/subscriptions","organizations_url":"https://api.github.com/users/kennyung6/orgs","repos_url":"https://api.github.com/users/kennyung6/repos","events_url":"https://api.github.com/users/kennyung6/events{/privacy}","received_events_url":"https://api.github.com/users/kennyung6/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PaoloRotolo/AppIntro/labels/under%20investigation","name":"under investigation","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-08T23:40:38Z","updated_at":"2016-06-09T10:10:26Z","closed_at":null,"body":"Please check off the following things BEFORE submitting a new issue. Any issues that do not properly follow this format will be closed without discussion. If you're requesting to have your app added to the list, you can erase the list and provide your app's name and play store listing link. Thanks!\r\n\r\n[ ] What you've tried (include code snippets, or whole files as necessary):\r\n\r\nadded the Show intro once example code to my splash screen\r\n\r\n` //  Declare a new thread to do a preference check\r\n        Thread t = new Thread(new Runnable() {\r\n            @Override\r\n            public void run() {\r\n                //  Initialize SharedPreferences\r\n                SharedPreferences getPrefs = PreferenceManager\r\n                        .getDefaultSharedPreferences(getBaseContext());\r\n\r\n                //  Create a new boolean and preference and set it to true\r\n                boolean isFirstStart = getPrefs.getBoolean(\"firstStart\", true);\r\n\r\n                //  If the activity has never started before...\r\n                if (isFirstStart) {\r\n\r\n                    //  Launch app intro\r\n                    Intent i = new Intent(SplashActivity.this, app_intro.class);\r\n                    startActivity(i);\r\n\r\n                    //  Make a new preferences editor\r\n                    SharedPreferences.Editor e = getPrefs.edit();\r\n\r\n                    //  Edit preference to make it false because we don't want this to run again\r\n                    e.putBoolean(\"firstStart\", false);\r\n\r\n                    //  Apply changes\r\n                    e.apply();\r\n                }\r\n            }\r\n        });\r\n\r\n        // Start the thread\r\n        t.start();`\r\n\r\n[ ] What you thought should happen:\r\n\r\nIt should move from splashscreen activity to Main activity after the intro has been shown once\r\n\r\n[ ] What actually happened:\r\n\r\nunfortunately, it doesn't go beyond the splashscreen activity. it freezes.\r\n"},"comment":{"url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/comments/224853704","html_url":"https://github.com/PaoloRotolo/AppIntro/issues/245#issuecomment-224853704","issue_url":"https://api.github.com/repos/PaoloRotolo/AppIntro/issues/245","id":224853704,"user":{"login":"kennyung6","id":12512546,"avatar_url":"https://avatars.githubusercontent.com/u/12512546?v=3","gravatar_id":"","url":"https://api.github.com/users/kennyung6","html_url":"https://github.com/kennyung6","followers_url":"https://api.github.com/users/kennyung6/followers","following_url":"https://api.github.com/users/kennyung6/following{/other_user}","gists_url":"https://api.github.com/users/kennyung6/gists{/gist_id}","starred_url":"https://api.github.com/users/kennyung6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennyung6/subscriptions","organizations_url":"https://api.github.com/users/kennyung6/orgs","repos_url":"https://api.github.com/users/kennyung6/repos","events_url":"https://api.github.com/users/kennyung6/events{/privacy}","received_events_url":"https://api.github.com/users/kennyung6/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T10:10:26Z","updated_at":"2016-06-09T10:10:26Z","body":"Okay Below is my Splash Activity and app_intro activity class.\r\n\r\nAgain, The Splash Activity is the first activity to be launched at start, then the app_intro activity (show only once - For 1st time use only), then to MainActivity. Thanks\r\n\r\n# **SplashActivity.java**\r\n`public class SplashActivity extends AppCompatActivity {\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        Intent i = new Intent(SplashActivity.this, app_intro.class);\r\n        startActivity(i);\r\n\r\n    }\r\n}`\r\n\r\n# **app_intro.java**\r\n\r\n`public class app_intro extends AppIntro {\r\n\r\n    @Override\r\n    protected void onCreate (Bundle savedInstance) {\r\n\r\n        super.onCreate(savedInstance);\r\n\r\n        //Default App intro Settings\r\n        addSlide(SampleSlide.newInstance(R.layout.intro));\r\n        addSlide(SampleSlide.newInstance(R.layout.intro2));\r\n        addSlide(SampleSlide.newInstance(R.layout.intro3));\r\n        addSlide(SampleSlide.newInstance(R.layout.intro4));\r\n\r\n        //Set Slide Animation\r\n        setFadeAnimation();\r\n\r\n        //Turn Vibration on & Intensity\r\n        setVibrate(true);\r\n        setVibrateIntensity(30);\r\n\r\n        //setBarColor(Color.parseColor(\"#3F51B5\"));\r\n        setSeparatorColor(Color.parseColor(\"#2196F3\"));\r\n    }\r\n\r\n    private void loadMainActivity() {\r\n\r\n        Intent intent = new Intent(this, MainActivity.class);\r\n        startActivity(intent);\r\n    }\r\n\r\n    @Override\r\n    public void onSkipPressed(Fragment currentFragment) {\r\n        super.onSkipPressed(currentFragment);\r\n        loadMainActivity();\r\n        Toast.makeText(getApplicationContext(),getString(R.string.skip), Toast.LENGTH_SHORT).show();\r\n    }\r\n\r\n    @Override\r\n    public void onDonePressed(Fragment currentFragment) {\r\n        super.onDonePressed(currentFragment);\r\n        loadMainActivity();\r\n    }\r\n}\r\n`"}}
{"actor":{"display_login":"kennyung6"}}