mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Tests to verify Android native features.
This commit is contained in:
Executable
+49
@@ -0,0 +1,49 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Backbutton</title>
|
||||
|
||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
|
||||
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
|
||||
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
|
||||
<script type="text/javascript" src="../cordova.js"></script>
|
||||
|
||||
<script>
|
||||
document.addEventListener("deviceready", onDeviceReady, false);
|
||||
|
||||
// Without backbutton handler, each tab loaded will be popped off history until history is empty, then it will exit app.
|
||||
function handleBackButton() {
|
||||
alert("Back Button Pressed! - exiting app");
|
||||
navigator.app.exitApp();
|
||||
}
|
||||
|
||||
function onDeviceReady() {
|
||||
console.log("onDeviceReady()");
|
||||
document.addEventListener("backbutton", handleBackButton, false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page" id="tabTab">
|
||||
<div data-role="header">
|
||||
<h1>Main</h1>
|
||||
</div>
|
||||
<div data-role="content" id="tabContent">
|
||||
To test, press several tabs.<br>
|
||||
The "backbutton" can be pressed any time to exit app.
|
||||
</div>
|
||||
<div data-role="footer" data-position="fixed">
|
||||
<div data-role="navbar">
|
||||
<ul>
|
||||
<li><a href="tab1.html" data-transition="none">Tab 1</a>
|
||||
</li>
|
||||
<li><a href="tab2.html" data-transition="none">Tab 2</a>
|
||||
</li>
|
||||
<li><a href="tab3.html" data-transition="none">Tab 3</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user