Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oncreate not used anymore #18

Open
tonyneel923 opened this issue Jan 12, 2017 · 5 comments
Open

Oncreate not used anymore #18

tonyneel923 opened this issue Jan 12, 2017 · 5 comments

Comments

@tonyneel923
Copy link

I am not sure how to use this in new versions of react as I do not think they use onCreate anymore. Any suggestions?

@iswanj
Copy link

iswanj commented Jan 13, 2017

public class MainActivity extends ReactActivity {
    public static Activity activity;
    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        SplashScreen.show(this);
        return "mobileapp";
    }

}

I did that like this and its working fine. But there is a problem with it, it showing white page just for 1 second before show splash screen.

@tonyneel923
Copy link
Author

@iswanj I also saw this but it is essentially the same as showing a splash from a component instead of natively. I was hoping to replicate true native behavior. Thanks for the help.

@tonyneel923
Copy link
Author

Oncreate still works you just need to import bundle which was not clear to me. There is however still a white screen unfortunately.

@ayushnawani
Copy link

@tonyneel923 did you able to find any solution for 1 second white screen before splash screen ?

@ethanyuwang
Copy link

ethanyuwang commented Nov 20, 2019

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants