Skip to content

Commit

Permalink
Fix #332
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Development committed Apr 11, 2015
1 parent 3c07829 commit a871712
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Expand Up @@ -228,7 +228,8 @@ else if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP))
}
if(keyCode == KeyEvent.KEYCODE_BACK)
{
NewsDetailFragment ndf = (NewsDetailFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + currentPosition);
NewsDetailFragment ndf = getNewsDetailFragmentAtPosition(currentPosition);//(NewsDetailFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + currentPosition);

if(ndf != null && ndf.mWebView != null)
{
if(ndf.mWebView.canGoBack())
Expand Down Expand Up @@ -538,19 +539,9 @@ public SectionsPagerAdapter(FragmentManager fm) {
@Override
public Fragment getItem(int position) {
NewsDetailFragment fragment = null;
int key;
for(int i = 0; i < items.size(); i++) {
key = items.keyAt(i);
WeakReference<NewsDetailFragment> wr = items.get(key);
if(wr.get() != null) {
if ((wr.get()).getSectionNumber() == position){
fragment = wr.get();
break;
}
} else {
items.remove(key);//Remove null pointer --> Should never happen
i--; //One key removed (at position i -> so reduce i by one)
}

if(items.get(position) != null) {
fragment = items.get(position).get();
}

if(fragment == null) {
Expand Down
Expand Up @@ -358,6 +358,9 @@ else if (idFolder != null) {
dbConn.insertIntoRssCurrentViewTable(sqlSelectStatement);
}
}

setUpdateListViewOnStartUp(false);//Always reset this variable here. Otherwise the list will be cleared when the activity is restarted

return dbConn.getCurrentRssItemView(sortDirection);
}

Expand Down

0 comments on commit a871712

Please sign in to comment.