title: How to Finish Activity?
body: <p>I am working with Recyclerview . i want to finish current Activity from its holder.when i click on item i want to open New Activity and Finish the current activity. pls help
  my code is shown below`</p>
  
  <pre><code>public class GcmNotificationHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
      protected TextView gcmMessage;
      protected TextView  messageTital;
      protected  TextView messageDate;
      protected ImageButton removeMessage;
      protected Context context;
      protected  List&lt;Notification&gt; notificationList;
      protected  boolean isRead = true;
  
      public GcmNotificationHolder(View itemView, List&lt;Notification&gt; notificationList, Context applicationContext) {
          super(itemView);
          itemView.setOnClickListener(this);
            context = applicationContext;
          this.gcmMessage = (TextView)itemView.findViewById(R.id.gcmMessage);
          this.messageTital=(TextView)itemView.findViewById(R.id.messagTital);
          this.messageDate=(TextView)itemView.findViewById(R.id.gcmMessageDate);
          this.notificationList = notificationList;
      }
  
  
  
      @Override
      public void onClick(View v) {
  
          Intent intent = new Intent(context.getApplicationContext(), NotificationDescriptionActivity.class);
          intent.putExtra("messageDescription", notificationList.get(getAdapterPosition()).getMessage());
          intent.putExtra("messageTital", notificationList.get(getAdapterPosition()).getMessagetital());
          intent.putExtra("messageDate", notificationList.get(getAdapterPosition()).getMessagedate());
           notificationList.get(getAdapterPosition()).getId();
           notificationList.get(getAdapterPosition()).setIsRead(true);
          DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context, "notification-db", null);
          SQLiteDatabase db = helper.getWritableDatabase();
          DaoMaster daoMaster = new DaoMaster(db);
          DaoSession daoSession = daoMaster.newSession();
          NotificationDao notificationDao = daoSession.getNotificationDao();
          notificationDao.updateInTx(notificationList);
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          context.startActivity(intent);
  
  }}
  </code></pre>