How to navigate one page to another page in android phonegap?

I am new to PhoneGap.

My application has to 2 pages. The first is loading fine. First page contains one buttons, which when clicked should move to the second page. How to load the second page? Should I prepare one more activity extending DriodGap?

  • Ionic emulate ios only works with --livereload
  • Android: How to set text color for list items in AlertDialog properly
  • TextInputLayout and AutoCompleteTextView
  • Activity OnCreate called when phone goes to sleep
  • GSON : custom object deserialization
  • dismiss the popup window by back button
  • I have one more problem: how to catch back button events?

    Related posts:

    EGL_BAD_MATCH error Android Studio
    Missing adActivity with android:configChanges in AndroidManifest.xml
    SimpleCursorAdapter vs CursorAdapter?
    How to access widgets in a custom DialogPreference with a inflated layout?
    Make FAB respond to Soft Keyboard show/hide changes
    Android ActionBar backbutton and tabs
  • get text from pressed button
  • Android Studio is not loading on the device, local path doesn't exist
  • remove line between custom option menu items
  • Change the color of divider in LinearLayout
  • Sqlite DB with Android some basic questions
  • How to perform Auto crop for document Recognize image using camera?
  • One Solution collect form web for “How to navigate one page to another page in android phonegap?”

    Code to navigate to another html page.

    <!DOCTYPE HTML>
    <html>
      <head>
        <title>PhoneGap</title>
    
              <script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>      
              <script type="text/javascript" charset="utf-8">
    
                 function onLoad()
                 {
                      document.addEventListener("deviceready", onDeviceReady, true);
                 }
    
                 function onDeviceReady()
                 {
                      // navigator.notification.alert("PhoneGap is working");
                 }
    
                 function callAnothePage()
                 {
                    window.location = "test.html";
                 }
    
              </script>
    
      </head>
    
      <body onload="onLoad();">
            <h1>Welcome to PhoneGap</h1>
            <h2>Edit assets/www/index.html</h2>
            <button name="buttonClick" onclick="callAnothePage()">Click Me!</button>
      </body>
    

    Code for back Event.

    <script type="text/javascript" charset="utf-8">
    
                 document.addEventListener("deviceready", onDeviceReady, true);
    
                 function onDeviceReady()
                 {     
                       document.addEventListener("backbutton", BackKeyDown, true);
                 }
    
                 function BackKeyDown()
                 {
                     navigator.notification.alert();
                     //navigator.app.exitApp();  // For Exit Application
                 }
            </script>
    
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.