@Override
 public void onHeadlineSelected(int articleIndex) {
   this.articleIndex = articleIndex;
   if (hasTwoPanes) {
     // display it on the article fragment
     display.setArticle(getCurrentCategory().getArticle(articleIndex));
   } else {
     display.showArticleActivity(categoryIndex, articleIndex);
   }
 }
 private void setCategory(int categoryIndex, int articleIndex) {
   this.categoryIndex = categoryIndex;
   this.articleIndex = articleIndex;
   NewsCategory category = getCurrentCategory();
   display.setCategory(CATEGORIES[categoryIndex], category);
   // If we are displaying the article on the right, we have to update that too
   if (hasTwoPanes) {
     if (articleIndex == NO_ARTICLE) {
       // Default to first article.
       display.setArticle(category.getArticle(0));
     } else {
       display.setArticle(category.getArticle(articleIndex));
     }
   }
 }
 @Override
 public void categoryButtonClicked() {
   display.showCategoryDialog(CATEGORIES);
 }
 @Override
 public void onCreate(boolean hasTwoPanes, int categoryIndex) {
   this.hasTwoPanes = hasTwoPanes;
   display.setUpActionBar(CATEGORIES, hasTwoPanes, categoryIndex);
 }