Closed avishayil closed 8 years ago
I just pushed a RN 0.29 compatible version last night. It's a huge hack and I haven't had time to document it. You need to store the package ref before the getPackages call and make sure to call setActivity on the onCreate in MainActivity.
If you have a better idea id love a PR.
Take a look on my fork: https://github.com/avishayil/rn-splash-screen
It works fine, but the only caveat is when you resume an activity, the splash is not being shown on Android. If you kill the activity form the recent apps, it shows fine.
@avishayil Why do you use postDelayed
?
For safety. sort of like making sure that the activity exists before removing the splashscreen.
The splash screen is removed from javascript where the Activity guaranteed to exist. I can see adding a configurable delay if you don't want to finetune where exactly its hidden.
@avishayil Also it looks like your splash screen fork loads too late some times. There is a data race. Every like 4th run I get a small white blip.
Looking into a solution now as my earlier hack is awful.
This should be resolved; check the revised documentation
Attempt to invoke virtual method 'void android.app.Activity.runOnUiThread(java.lang.runnable)' on a null object reference
SplashScreen.java: 35
, show function.I'll try to make a PR compatible with RN 0.29.