diff --git a/src/org/fox/ttrss/offline/OfflineArticlePager.java b/src/org/fox/ttrss/offline/OfflineArticlePager.java index 96c816b7..510ab97b 100644 --- a/src/org/fox/ttrss/offline/OfflineArticlePager.java +++ b/src/org/fox/ttrss/offline/OfflineArticlePager.java @@ -170,13 +170,16 @@ public class OfflineArticlePager extends Fragment { } m_cursor.moveToNext(); } + + Log.d(TAG, "(1)maId=" + m_articleId); + m_listener.onArticleSelected(m_articleId, false); } } else { if (m_cursor.moveToFirst()) { m_articleId = m_cursor.getInt(m_cursor.getColumnIndex(BaseColumns._ID)); m_listener.onArticleSelected(m_articleId, false); - Log.d(TAG, "maId=" + m_articleId); + Log.d(TAG, "(2)maId=" + m_articleId); } } diff --git a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java index a6c8b349..cc14bded 100644 --- a/src/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/src/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -279,13 +279,16 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead @Override public void onArticleSelected(int articleId, boolean open) { - SQLiteStatement stmt = getWritableDb().compileStatement( - "UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID - + " = ?"); - - stmt.bindLong(1, articleId); - stmt.execute(); - stmt.close(); + + if (!open) { + SQLiteStatement stmt = getWritableDb().compileStatement( + "UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID + + " = ?"); + + stmt.bindLong(1, articleId); + stmt.execute(); + stmt.close(); + } initMenu(); diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java index b40f3983..d3883879 100644 --- a/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java +++ b/src/org/fox/ttrss/offline/OfflineHeadlinesActivity.java @@ -107,13 +107,16 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline @Override public void onArticleSelected(int articleId, boolean open) { - SQLiteStatement stmt = getWritableDb().compileStatement( - "UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID - + " = ?"); - - stmt.bindLong(1, articleId); - stmt.execute(); - stmt.close(); + + if (!open) { + SQLiteStatement stmt = getWritableDb().compileStatement( + "UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID + + " = ?"); + + stmt.bindLong(1, articleId); + stmt.execute(); + stmt.close(); + } if (open) { OfflineArticlePager af = (OfflineArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);