title: Fully Closing a phonegap android app
body: <p>How do I fully close a PhoneGap Android app? I've tried using device.exitApp() as well as navigator.app.exitApp() and have the same problem with both.</p>
  
  <p>The problem is that I have an html file, index.html, that links to an external html file, main.html. Now if I hit the close button without going to the external file, the app closes just fine. If I go to the external file and then go back to index then hit close, it closes index but brings up main. How do I completely close the app whether or not I go the external page?</p>
  
  <p>Index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="Scripts/phonegap-1.0.0.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href="index.html"&gt;Index&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Main.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="Scripts/phonegap-1.0.0.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href="index.html"&gt;Index&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Android Manifest</p>
  
  <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
      &lt;activity android:name=".TestActivity"
                android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name="com.phonegap.DroidGap" 
              android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>