title: Going back after changing stateParams of $ionicHistory.backView()
body: <p>I am developing an android app using Ionic Framework.</p>
  
  <p>In that, I have three views, <code>view1, view2 and view3</code>.</p>
  
  <p>Navigation will be like <code>view1 -&gt; view2 -&gt; view3</code></p>
  
  <p>When moving back to <code>view2</code> from <code>view3</code>, I need to change a stateParam <code>param1</code> value of <code>view2</code> to perform some operations. Below code shows you that I am changing the stateParam value of <code>view2</code> when clicking back button in <code>view3</code></p>
  
  <p>Following is the code to override the action of android device backbutton</p>
  
  <pre><code>$ionicPlatform.registerBackButtonAction(function() {
  
        if ($state.current.name == "view3") {
            $ionicHistory.backView().stateParams = {param1:true};
            $ionicHistory.goBack(); // moves to view2
        } else {
            $ionicHistory.goBack();
        }
  
  }, 100);
  </code></pre>
  
  <p>After moving back to <code>view2</code>, If I click back button now, it is moving to <code>view3</code> and not to <code>view1</code>.  Now I am able to view only <code>view3</code> and <code>view2</code> by clicking back button, Not at all moving to <code>view1</code>.</p>
  
  <p>How to make back button to move to <code>view1</code> from <code>view2</code> Even after changing the stateParam value of <code>view2</code>?</p>