---
title: createNewActivity()
framework: classkit
role: symbol
role_heading: Instance Method
path: classkit/clscontext/createnewactivity()
---

# createNewActivity()

Creates and returns a new activity instance for the context.

## Declaration

```swift
func createNewActivity() -> CLSActivity
```

## Mentioned in

Recording student progress

## Return Value

Return Value A new activity.

## Discussion

Discussion Use this method to create a new activity for a context every time a person makes a new attempt at a task. Afterward, use the returned value, or retrieve it by accessing the context’s currentActivity property. However, don’t store a reference to the activity as a class property because the underlying object may change from time to time as the framework performs network synchronization. When you call this method on a context that already has an activity, the old activity is stopped and ceases to be accessible to your app, although its data remains in the network.

## See Also

### Creating activities

- [currentActivity](classkit/clscontext/currentactivity.md)
