package com.sarality.app.view.nav;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.sarality.app.view.action.BaseViewAction;
import com.sarality.app.view.action.TriggerType;
import com.sarality.app.view.action.ViewActionTrigger;
import com.sarality.app.view.action.ViewDetail;

/**
 * Starts new activity when a class when an item is clicked.
 * 
 * @author yogesh@ (Yogesh Kumar)
 * 
 * @param <T> Type of data object needed to start the Activity.
 */
public class StartActivityAction extends BaseViewAction {

  // The context of the class that is calling the action
  protected final Context context;

  // The class that has to be opened.
  private final Class<? extends Activity> newActivityClass;

  /**
   * Constructor.
   * 
   * @param viewId Id of view that triggers the action.
   * @param triggerType Type of event that triggers the action.
   * @param context Context of the class that triggers the action.
   * @param Class Class for the Activity that has to be started.
   */
  public StartActivityAction(int viewId, TriggerType triggerType, Context context,
      Class<? extends Activity> newActivityClass) {
    super(viewId, triggerType);
    this.context = context;
    this.newActivityClass = newActivityClass;
  }

  @Override
  public boolean doAction(View view, ViewActionTrigger actionDetail, ViewDetail viewDetail) {
    Intent intent = new Intent(context, newActivityClass);
    context.startActivity(intent);
    return true;
  }
}

@@ -121,16 +121,42 @@
 Intent;%0A
+import android.os.Bundle;%0A
 import a
@@ -1504,16 +1504,140 @@
 Class);%0A
+    Bundle bundle = new Bundle();%0A    bundle.putLong(%22ID%22, (Long) view.getTag(view.getId()));%0A    intent.putExtras(bundle);%0A
     cont

Send ID in the intent while creating a new activity