Monkey测试com.android.browser 发 生类似android.datab
[DESCRIPTION]
monkey測(cè)試com.android.browser模塊時(shí),可能會(huì)遇到如下exception:
// CRASH: com.android.browser (pid 17743)
// Short Msg: android.database.StaleDataException
// Long Msg: android.database.StaleDataException: Attempting to access a
closed CursorWindow.Most probable cause: cursor is deactivated prior to
calling this method.
// android.database.StaleDataException: Attempting to access a closed
CursorWindow.Most probable cause: cursor is deactivated prior to calling
this method.
// at
android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCurs
or.JAVA:156)
// at
android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.jav
a:85)
// at android.database.CursorWrapper.getLong(CursorWrapper.java:106)
// at
com.android.browser.BrowserSnapshotPage$SnapshotAdapter.bindView(BrowserSn
apshotPage.java:282)
// at android.widget.CursorAdapter.getView(CursorAdapter.java:254)
// at android.widget.AbsListView.obtainView(AbsListView.java:2300)
// at android.widget.GridView.onMeasure(GridView.java:1044)
// at
com.android.browser.view.SnapshotGridView.onMeasure(SnapshotGridView.java:
51)
// at android.view.View.measure(View.java:16849)
......
[SOLUTION]
此異常由于app在使用已經(jīng)關(guān)閉的cursor,可以按照如下方法修改解決:
修改packages/apps/Browser/src/com/android/browser/BrowserSnapshotPage.java
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
Cursor c = mAdapter.getItem(position);
String title = c.getString(SNAPSHOT_TITLE);
String url = "file://" + c.getString(SNAPSHOT_VIEWSTATE_PATH);
--刪除這一行 c.close();
mCallback.openSnapshot(id, title, url);
}
因?yàn)槲覀冎安⒉皇谴蜷_(kāi)一個(gè)cursor,所以這兒不需要關(guān)閉。
?
?
此資料( Monkey測(cè)試com.android.browser 發(fā) 生類似android.datab)轉(zhuǎn)載于 一牛網(wǎng)
資料需要自己去下載,有需要的可以去論壇上面自己下載
轉(zhuǎn)載于:https://www.cnblogs.com/yiliu16/p/5367989.html
總結(jié)
以上是生活随笔為你收集整理的Monkey测试com.android.browser 发 生类似android.datab的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Oracle 自己主动诊断资料档案库 (
- 下一篇: 从数组中间位置添加元素:unshift(