-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSS entry content not showing #1
Comments
I did the following: //load article details to main panel
Bundle arguments = new Bundle();
arguments.putSerializable (Article.KEY, selected);
if (mTwoPane) {
ArticleDetailFragment fragment = new ArticleDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.replace(R.id.article_detail_container, fragment)
.commit();
} else {
Intent detailIntent = new Intent(this, ArticleDetailActivity.class);
detailIntent.putExtra("arguments", arguments);
startActivity(detailIntent);
} if (savedInstanceState == null) {
Bundle arguments = getIntent().getBundleExtra("arguments");
ArticleDetailFragment fragment = new ArticleDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.add(R.id.article_detail_container, fragment)
.commit();
} |
Dear eRGoon, ArticleListFragment fragment = (ArticleListFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.article_list); Any idea to solve this? |
Hi BeDave, are you sure about this? I cannot find such line in ArticleDetailFragment. |
Yep, i'm pretty sure about this. |
Indeed, the fragment cannot be found. If I just get the fragment it already returns null.
However, it only does so when running in a one pane layout. If you are on a tablet, it doesn't happen when you mark it as unread. Unfortunately, I've not been able to fix it, so my solution is removing the menu item on one-pane layouts using this: private static boolean mTwoPane; // change to static
public static boolean isTwoPane() {
return mTwoPane;
} In ArticleDetailFragment: @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.detailmenu, menu);
if (!ArticleListActivity.isTwoPane()) { // add this
menu.removeItem(R.id.actionbar_markunread);
}
}
// if you want extra security
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.actionbar_saveoffline) {
Toast.makeText(getActivity().getApplicationContext(),
R.string.saved_for_offline, Toast.LENGTH_LONG).show();
return true;
} else if (id == R.id.actionbar_markunread) {
db.openToWrite();
db.markAsUnread(displayedArticle.getGuid());
db.close();
displayedArticle.setRead(false);
try {
ArticleListAdapter adapter = (ArticleListAdapter) ((ArticleListFragment) getActivity()
.getSupportFragmentManager().findFragmentById(
R.id.article_list)).getListAdapter();
adapter.notifyDataSetChanged();
} catch (NullPointerException e) {
}
return true;
} else {
return super.onOptionsItemSelected(item);
}
} |
@eRGoon Solution worked for me, Thank You !! |
not working buddy.. |
As for me, i didnt get any feeds in the list view at all even after leaving it for a few minutes. i have used the rss feeds of NYT, http://rss.nytimes.com/services/xml/rss/nyt/World.xml, Aljazeera: http://www.aljazeera.com/xml/rss/all.xml, still the samething. i am stuck here |
while after loading about 15sec , the app has stopped,why ? |
After I updated the node names for my RSS feed, I get the entries in list view.
But selecting one entry only shows an empty details page.
Checking the sources, I found that the item_id is passed to a new ArticleDetailFragment activity
which creates a new fragment setting the item_id as String
but the fragment only sets displayedArticle if the Article.KEY is set and I can't find where it handles the item_id.
Am I wrong? Solution for this?
The text was updated successfully, but these errors were encountered: