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,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();
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user