Fix #332
This commit is contained in:
parent
3c078290bc
commit
a871712216
2 changed files with 8 additions and 14 deletions
|
@ -228,7 +228,8 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
}
|
||||
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())
|
||||
|
@ -538,19 +539,9 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
@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) {
|
||||
|
|
|
@ -358,6 +358,9 @@ public class NewsReaderDetailFragment extends ListFragment implements IOnStayUnr
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue