headlines: in onContextItemSelected check if adapter context menu info is there

This commit is contained in:
Andrew Dolgov 2017-06-08 18:46:34 +03:00
parent 7bdfe419aa
commit f172c5b2ac

View File

@ -249,12 +249,15 @@ public class HeadlinesFragment extends Fragment {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
.getMenuInfo();
Article article = getArticleAtPosition(info.position - m_adapter.getHeaderCount());
if (info != null) {
if (!onArticleMenuItemSelected(item, article, info.position))
return super.onContextItemSelected(item);
else
return true;
Article article = getArticleAtPosition(info.position - m_adapter.getHeaderCount());
if (!onArticleMenuItemSelected(item, article, info.position))
return super.onContextItemSelected(item);
}
return super.onContextItemSelected(item);
}
public HeadlinesFragment() {