如何完全关闭PhoneGap Android应用程序?我尝试过使用device.exitApp()以及navigator.app.exitApp(),并且两者都有同样的问题.
问题是我有一个html文件index.html链接到外部html文件main.html.现在,如果我在没有转到外部文件的情况下点击关闭按钮,应用程序就会关闭.如果我转到外部文件,然后返回索引然后点击关闭,它关闭索引,但带来主要.无论我是否进入外部页面,如何完全关闭应用程序?
的index.html
<html>
<head>
<script type="text/javascript" src="Scripts/phonegap-1.0.0.js"></script>
</head>
<body>
<a href="index.html">Index</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
main.html中
<html>
<head>
<script type="text/javascript" src="Scripts/phonegap-1.0.0.js"></script>
</head>
<body>
<a href="index.html">Index</a>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
Android Manifest
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".TestActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.phonegap.DroidGap"
android:label="@string/app_name" android:configChanges="orientation|keyboardHidden">
</activity>
</application>
Run Code Online (Sandbox Code Playgroud) 我正在学习LINQ,我想知道是否有任何方法可以使用它来实际生成列表,而不仅仅是查询已经生成的列表.所以我有以下代码使用for循环来获得一个随机大小的整数列表并用随机数填充它,无论如何将其转换为LINQ?
var ret = new List<int>();
for (var i = 0; i < _rand.Next(100); i++)
ret.Add(_rand.Next(10));
Run Code Online (Sandbox Code Playgroud)