Exemplo n.º 1
0
  @Override
  public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    NewsListEntity entity = (NewsListEntity) mAdapter.getItem(position);
    if (entity == null) return;

    Intent intent = new Intent(getActivity(), NewsDetailActivity.class);
    intent.putExtra("id", entity.id);
    intent.putExtra("newsEntity", entity);
    startActivity(intent);
  }
Exemplo n.º 2
0
 @Override
 public boolean onMenuItemClick(int position, SwipeMenu menu, int index) {
   NewsListEntity entity = (NewsListEntity) mAdapter.getItem(position);
   switch (index) {
     case 0:
       MainActivity.instance.showShare(entity.title);
       break;
     case 1:
       favoriteDao(entity, entity.id);
       break;
   }
   return false;
 }