title: $ionicHistory.clearHistory clears the history but goes to previous view when hardwareBackButton clicked on android?
body: <p>this is my code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>.controller("HomeCtrl", function ($scope,$ionicHistory,SearchService) {
  
    $scope.history = $ionicHistory.viewHistory(); 
    $scope.clearhistory = function(){
      $ionicHistory.clearHistory();
      $scope.history = $ionicHistory.viewHistory();
    }
    
  })
  
  
  .state('eventmenu.home', {
    url: "/home",
    cache: false,
    views: {
      'menuContent' :{
        templateUrl: "templates/home.html",
        controller: "HomeCtrl"
      }
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>ion-view title='&lt;a href="#/event/home"&gt;&lt;img class="title-image" src="img/acc.png" height = "40px" width = "120px"/&gt;&lt;/a&gt;'&gt;
    &lt;ion-content class="padding" ng-hide="searchBarVisibility"&gt;
      &lt;pre&gt;{{history | json}}&lt;/pre&gt;
      &lt;button ng-click="clearhistory()"&gt;clear&lt;/button&gt;
    &lt;/ion-content&gt;
  &lt;/ion-view&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have 10 states in my app in the same view. the 10th state has a link to home page.when i go to the home page through the 10th state, {{history}} shows all the states traversed and when i press the clear button all the history gets cleared as well and i get the following output.</p>
  
  <pre><code>    "histories": {
      "root": {
        "historyId": "root",
        "parentHistoryId": null,
        "stack": [],
        "cursor": -1
      },
      "ion1": {
        "historyId": "ion1",
        "parentHistoryId": "root",
        "stack": [
          {
            "viewId": "ion33",
            "index": 1,
            "historyId": "ion1",
            "backViewId": null,
            "forwardViewId": null,
            "stateId": "eventmenu.home",
            "stateName": "eventmenu.home",
            "url": "/event/home",
            "canSwipeBack": true,
            "title": "&amp;lt;a href=\"#/event/home\"&amp;gt;&amp;lt;img class=\"title-image\" src=\"img/acc.png\" height = \"40px\" width = \"120px\"/&amp;gt;&amp;lt;/a&amp;gt;"
          }
        ],
        "cursor": -1
      },
      "ion5": {
        "historyId": "ion5",
        "parentHistoryId": "root",
        "stack": [],
        "cursor": -1
      }
    },
    "views": {
      "ion33": {
        "viewId": "ion33",
        "index": 1,
        "historyId": "ion1",
        "backViewId": null,
        "forwardViewId": null,
        "stateId": "eventmenu.home",
        "stateName": "eventmenu.home",
        "url": "/event/home",
        "canSwipeBack": true,
        "title": "&amp;lt;a href=\"#/event/home\"&amp;gt;&amp;lt;img class=\"title-image\" src=\"img/acc.png\" height = \"40px\" width = \"120px\"/&amp;gt;&amp;lt;/a&amp;gt;"
      }
    },
    "backView": null,
    "forwardView": null,
    "currentView": {
      "viewId": "ion33",
      "index": 1,
      "historyId": "ion1",
      "backViewId": null,
      "forwardViewId": null,
      "stateId": "eventmenu.home",
      "stateName": "eventmenu.home",
      "url": "/event/home",
      "canSwipeBack": true,
      "title": "&amp;lt;a href=\"#/event/home\"&amp;gt;&amp;lt;img class=\"title-image\" src=\"img/acc.png\" height = \"40px\" width = \"120px\"/&amp;gt;&amp;lt;/a&amp;gt;"
    }
  </code></pre>
  
  <p>But the problem arises when i click the hardware button of android. The app again traverses all the states previously visited instead of exiting the app.And when it return back to the home page, the history stack is again filled. Why is this happening even if the history has been cleared and what should i do to make the app exit after clicking back button if the history is cleared.</p>