Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9516

Android SplashScreen - Spinner Does Not Display

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.1
    • Fix Version/s: None
    • Labels:
    • Environment:

      Cordova 5 and Android Lollipop 5.0 and 5.1


      The spinner dialog is not displaying on Android. I believe one cause of this is the message "spinner > stop" which being used to display the webview, is also stopping the spinner prematurely.

      See this comment in CoreAndroid.js:

      // This gets called from JavaScript onCordovaReady to show the webview.
      // I recommend we change the name of the Message as spinner/stop is not
      // indicative of what this actually does (shows the webview).
      cordova.getActivity().runOnUiThread(new Runnable() {
      public void run()

      { webView.getPluginManager().postMessage("spinner", "stop"); }


      The "spinner > stop" message is fired almost immediately after SplashScreen.spinnerStart() is called, thus hiding the spinner before it actually displays. I was able to partially fix this by commenting out the call to spinnerStop() in the "spinner > stop" message handler:

      if ("spinner".equals(id)) {
      if ("stop".equals(data.toString()))

      { //this.spinnerStop(); getView().setVisibility(View.VISIBLE); }


      The second issue, at least for Cordova 5 and Lollipop, is that in the pluginInitialize() method, loadSpinner() is being called before showSplashScreen(true).
      I reversed these lines and made the change above and now the splashscreen displays correctly.


        Issue Links



            • Assignee:
              the.ludz Mark Ludlow


              • Created:

                Issue deployment