I am new to PhoneGap. I am using it to deploy my website on android phone. So I created www folder in assets folder and put all my HTML, CSS an js file and written this code to call the index.html page
import org.apache.cordova.DroidGap;
import android.app.ActionBar;
import android.os.Bundle;
import android.view.Window;
public class HelloPhoneGapActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
Every thing is working fine but now I have to add Action Bar with close button on every page. I don’t know how to do that.
Use
navigator.app.exitApp();to exit the application. Either do it on the click of a button or override the back key.UPDATE:
Create a listener like this
Then in the onBackClickEvent() write this