- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我们正在使用最新的 AC (3.1.0) + jquery mobile 开发移动应用程序。该应用程序在 google play 商店 ( https://play.google.com/store/apps/details?id=com.mventix.sellPro&hl=bg ) 上可用,但我们遇到了奇怪的问题。当应用程序启动时,打开不同的 View 并做一些事情是没有问题的。但是当应用程序进入后台一段时间(只要它发生在 10 分钟到 2-3 小时之间)并且在恢复应用程序后用户界面被卡住并且没有任何响应也没有错误打印在 logcat 中。我们必须终止应用程序并重新启动它才能使其正常工作。此外,我们正在使用 WEBSQL 和 LocalStorage,我们还将一些文件存储在 app/cache/中,因为该应用程序需要在没有互联网的情况下运行。我们正在使用 cordova 中的许多插件。我在 apache cordova bugtracker 中发现了类似的错误,但它们适用于较旧的 cordova 版本。
在这两个地方,问题看起来很相似,但据我所知,它们已在最新的 cordova 版本中修复。
此问题出现在(android 4.0.3、4.1.2、4.2.2)这些设备上,包括 LG nitro、HP slate 7 Samsung GT2 7inch samsung sIII 和 s IV。
按照这个顺序,我阅读并搜索了 phonegap 论坛和 stackoverflow,但我没有尝试解决我的问题。到目前为止,我们尝试过:
@Override
public void onDestroy() {
// TODO Auto-generated method stub
super.loadUrl("about:blank");
super.onDestroy();
}
我们还尝试了这个修复来增加超时 @覆盖 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
super.init();
super.setIntegerProperty("loadUrlTimeoutValue", 60000);
super.setBooleanProperty("keepRunning", false);
super.loadUrl(Config.getStartUrl());
我们的 config.xml 看起来像这样:
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.helloCordova" version="2.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>SellPro</name>
<description>
SellPro
</description>
<author email="support@vertinity.com" href="http://www.vertinity.com">
Vertinity LTD Team
</author>
<content src="index.html" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<access origin="*" />
<preference name="useBrowserHistory" value="false" />
<preference name="exit-on-suspend" value="true" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="splashscreen" value="splash" />
<preference name="splashScreenDelay" value="10000" />
<feature name="File">
<param name="android-package" value="org.apache.cordova.core.FileUtils" />
</feature>
<feature name="FileTransfer">
<param name="android-package" value="org.apache.cordova.core.FileTransfer" />
</feature>
<feature name="ExtractZipFilePlugin">
<param name="android-package" value="org.apache.cordova.core.ExtractZipFilePlugin" />
</feature>
<feature name="PdfPanel">
<param name="android-package" value="com.vertinity.pdfPanel.PdfPanel" />
</feature>
<feature name="SocialShare">
<param name="android-package" value="com.vertinity.socialShare.SocialShare" />
</feature>
<feature name="Media">
<param name="android-package" value="org.apache.cordova.core.AudioHandler" />
</feature>
<feature name="MXPlayer">
<param name="android-package" value="com.vertinity.mxPlayer.MXPlayer" />
</feature>
<feature name="org.apache.cordova.core.ParsePlugin">
<param name="android-package" value="org.apache.cordova.core.ParsePlugin" />
</feature>
<feature name="WebIntent">
<param name="android-package" value="android.WebIntent" />
</feature>
<feature name="NetworkStatus">
<param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager" />
</feature>
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.splashscreen.SplashScreen" />
</feature>
</widget>
我们的 andoidManifest 看起来像这样:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:clearTaskOnLaunch="true"
android:hardwareAccelerated="true"
android:versionCode="4"
android:versionName="1.0.12"
package="com.mventix.sellPro"
xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="16" />
<application android:debuggable="true"
android:hardwareAccelerated="true"
android:largeHeap="true"
android:clearTaskOnLaunch="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:name=".sellProApplication" >
<activity android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:label="@string/app_name"
android:name="sellPro"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.facebook.LoginActivity"
android:label="@string/app_name" >
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
</application>
</manifest>
我希望有人能帮助我,或者只是向我解释到底发生了什么,这样我就可以开始朝着正确的方向进行研究。如果有人需要其他信息,我会提供所有需要的数据。
亲切的问候茨维坦
最佳答案
我记得有一次我遇到过类似的问题,当时我暂停了我的应用程序。不知何故(我不知道为什么)window.device
从挂起模式返回时未正确(重新)初始化。
所以我决定给 phonegap 多 1000 毫秒的时间来获取它的 window.device
这是一个 smapleCode 来了解我的意思:
一切以init();开始
<body onload="init()">
</body>
还有 中的 ScriptBlock <head>
部分:
<script type="text/javascript">
function init(){
console.log("init() called");
var promiseDeviceReady = onDeviceReady();
promiseDeviceReady.done(doPhoneGapStuff); //start PhoneGap action
}
function onDeviceReady() {
var deferred = $.Deferred();
var timeOut = 0;
//set a 1sec timeOut when App was send to suspendMode. SomeTimes PhoneGap needs it's time...
if (!window.device){
console.log("PhoneGap seems not to be ready yet!!!")
timeOut = 1000;
}
setTimeout(function() {
deferred.resolve();
}, timeOut);
return deferred.promise();
}
</script>
关于android - 回到前台时应用程序卡住(Cordova 3 + jquery mobile),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19519824/
我正在我的 xamarin.forms 应用程序中实现扫描仪功能,为此我正在使用 iOS native AVCaptureSession。但我的问题是在扫描或捕获 session 处于事件状态并且设备
所以我目前正在为我的项目制作一个音乐应用程序,它允许用户创建自己的音乐播放列表。但是,当我单击显示媒体选择器按钮时,它只显示白屏,当包含媒体选择器的 View 是 Initial View Contr
当我尝试在模拟器中启动 AVD 时,会出现一个小窗口(见图片),5 秒后它说没有响应并一直保持这种状态直到我关闭它。 我在网上搜索并尝试了所有解决方案,但都没有成功 在 BIOS 中启用了虚拟化 已安
尝试使用以下命令从视频中提取特定帧(删除了文件的特定名称!: ffmpeg -i video.mp4 -vf "select-gte(n\,6956)"-vframes 10262 文件夹/帧%d.j
我怎么知道终端正在继续工作而不中断它? 我已经运行了以下 git 命令: clone git://ligo-vcs.phys.uwm.edu/lalsuite.gituote 一段时间后它似乎被卡住了
我对 WPF 中的数据网格有一个奇怪的问题。我正在为我的应用程序使用 MVVM 模式,并且我的 View 模型实现了 idataerrorinfo 接口(interface)。每当我在添加新行后在我的
我有这个 Excel 文件,当我输入数据时它卡住了。例如,我双击一个单元格,输入数据,然后按“输入”。它会卡住而不是进入下面的细胞。按几次“enter”不会解冻程序,唯一有效的是用鼠标选择另一个单元格
我有线程池的任务队列,每个任务都有卡住锁定其正在使用的所有资源的倾向。并且除非重新启动服务,否则这些无法释放。 ThreadPool 中有没有办法知道它的线程已经被卡住?我有一个使用超时的想法(虽然我
我制作了以下小程序来确定内存是否用于 freeze(X,Goal) 之类的目标回收时 X变得无法访问: %:- use_module(library(freeze)). % Ciao Prolog n
我有一个使用 swing 的简单 java 应用程序。然而,当我执行程序时,框架将会出现,但我无法单击任何地方,并且按钮仅在几秒钟后出现。我对 javas Swing 库非常陌生,所以我可能会丢失一些
我正在尝试创建一个简单的 TCP 客户端服务器应用程序接口(interface)用户可以在按下相应按钮时启动或停止服务器我创建了一个 StartServer 按钮,当用户按下按钮时它应该连接到服务
我正在尝试从 ftp 服务器下载文件,但在检索文件时卡住了。我正在使用 commons-net-3.6.jar 我注意到的事情 当我使用 ftpClient.enterRemotePassiveMod
我正在尝试编写一个函数,该函数将能够找到位于我系统上的可执行文件搜索路径中的任意可执行文件。我遇到了一些输入会导致 SearchPathW 的问题无限期地卡住,我不确定到底发生了什么。 std::op
我的 Nativescript 应用程序的许多页面中都有 RadSideDrawer。主应用程序组件有一个 page-router-outlet并且所有其他页面都通过导航加载到此组件中。带抽屉的页面包
我有一个最小的服务器,它等待客户端连接,然后他启动一个线程,将回复发送回客户端,问题是回复。 这是服务器的代码: int port = 1234; ServerSocket servSock =
我有一个使用 C# 的 WinForms 应用程序。我尝试从文件中读取一些数据并将其插入到数据表中。虽然此操作很忙,但我的表单卡住并且我无法移动它。有谁知道我该如何解决这个问题? 最佳答案 这可能是因
在我们学校最新的项目中,我遇到了一些问题。我想观察新条目的路径,该路径是由文件导向器按钮选择的,但如果我选择任何文件,整个窗口都会卡住...我猜它被卡住,因为调用了“observePath”方法,但我
当我输入一百万作为输入数字时,我的程序卡住了。我该如何解决这个问题? 我尝试将第二个 for 循环分离为第二个函数,但没有成功。 import java.io.*; public class Arra
早上好编译我的应用程序时,我在 Android Studio 上遇到问题。我在构建时没有收到关于 app:transformClassesWithDexBuilderForDebug 的任何输出错误,
我正在使用以下触发器 DELIMITER ; CREATE TRIGGER updateCount AFTER INSERT ON user_info FOR EACH ROW BEGIN UPDA
我是一名优秀的程序员,十分优秀!