NathanWalker / nativescript-loading-indicator

Progress/Loading indicator with options for NativeScript. iOS + Android.
Apache License 2.0
112 stars 41 forks source link

[Android] Error: java.lang.IllegalArgumentException: View=DecorView not attached to window manager #54

Open DrewGregory opened 6 years ago

DrewGregory commented 6 years ago

When I navigate to a new page from an extended activity function (using frame.topmost().navigate()) (for me, onActivityResult) that uses a loading indicator, I get the exception listed below:

error console

If you are unfamiliar with extending activities, here is the documentation: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/extend-application-activity

DrewGregory commented 6 years ago

I also call .show() on the loading indicator, and nothing happens.

Here is the relevant source code:

exports.pageLoaded = function(args) {

  var loader = new LoadingIndicator();
  var options = {
    message: 'Loading...',
    progress: 0.65,
    android: {
      indeterminate: true,
      cancelable: false,
      max: 100,
      progressNumberFormat: "%1d/%2d",
      progressPercentFormat: 0.53,
      progressStyle: 1,
      secondaryProgress: 1
    }
  };
  loader.show(options);

  timer.setTimeout(() => {
    createGrid();
    loader.hide();
  }, 1000);
};
uzarsalan commented 5 years ago

Same issue