$state.go transition very slow in android

I have been seeing this very odd behavior in android where $state.go transitioning to another view is extremely slow.

Example usage: Within a async function, userInfo.signInSuccess.then(function (data) {


$state.go(‘main’);
});

Somehow, $state.go transitioning to main page is extremely slow, long after the user has already signed in successfully. In iOS devices, I see no issues but noticed this painfully slow login process only in Android. I am using Android 5.0 with chromium as well. Anyone come across this? Any recommended workaround to use another redirection mechanism to main page after sign in instead of $state.go is much appreciated ($location.path exhibits same behavior in android)

Thanks!

1 Like

In most cases the problem is gone with view caching.

But you are navigating to the page the first time, so nothing is cached.
And then it depends on what is shown in the mainpage.

You should keep in mind how the browser renders things during animation and scrolling.
Everytime something changed on the view you leave or enter can cause laggs.

So if you have a lot of stuff loading and showing during the transistion you will loose performance.
Like you are loading some data from an API -> during navigation the request finished and angularJS needs to refresh some models or lists gets filled and so.

If so you can use the ionicView events like:

$scope.$on('$ionicView.enter', function () {
   // the view is fully entered -> it is the active view and the transition has finished.
   // You could send your requests asyn but only show that dynamic content after transition has finished with setting a flag
  $scope.entered = true;
});
$scope.$on('$ionicView.beforeEnter', function () {
  // reset the flag in beforeEnter or leave
  $scope.entered = false;
});

http://ionicframework.com/docs/api/directive/ionView/

It depends what happens on your mainpage

I am stuck at the same issue. Did you find any solution??