Code example for Stack

Methods: add

0
     
    public void addActivity(Activity activity)
    { 
        if (activityStack == null)
        { 
            activityStack = new Stack<Activity>();
        } 
        activityStack.add(activity);
    } 
     
    public void addService(Service service)
    { 
        if (serviceStack == null)
        { 
            serviceStack = new Stack<Service>();
        } 
        serviceStack.add(service);
    } 
     
    public Activity currentActivity()
    {