do not mark article as read before opening it in offline mode which
screwed up the cursor (closes #800)
This commit is contained in:
parent
f2dde1362b
commit
d7c69cf591
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,6 +279,8 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
||||
|
||||
@Override
|
||||
public void onArticleSelected(int articleId, boolean open) {
|
||||
|
||||
if (!open) {
|
||||
SQLiteStatement stmt = getWritableDb().compileStatement(
|
||||
"UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID
|
||||
+ " = ?");
|
||||
@ -286,6 +288,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead
|
||||
stmt.bindLong(1, articleId);
|
||||
stmt.execute();
|
||||
stmt.close();
|
||||
}
|
||||
|
||||
initMenu();
|
||||
|
||||
|
@ -107,6 +107,8 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline
|
||||
|
||||
@Override
|
||||
public void onArticleSelected(int articleId, boolean open) {
|
||||
|
||||
if (!open) {
|
||||
SQLiteStatement stmt = getWritableDb().compileStatement(
|
||||
"UPDATE articles SET modified = 1, unread = 0 " + "WHERE " + BaseColumns._ID
|
||||
+ " = ?");
|
||||
@ -114,6 +116,7 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline
|
||||
stmt.bindLong(1, articleId);
|
||||
stmt.execute();
|
||||
stmt.close();
|
||||
}
|
||||
|
||||
if (open) {
|
||||
OfflineArticlePager af = (OfflineArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||
|
Loading…
Reference in New Issue
Block a user