• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Record replay

Syntax

Java

NewRelic.recordReplay()

Kotlin

NewRelic.recordReplay()

Requirements

  • Android agent v7.7.0 or higher.

    Description

    NewRelic.recordReplay() can be called to manually force a replay to begin recording. You must meet the following requirements:

  • Account is entitled to record replays

    If a replay is already in progress, or not all of the above criteria are met, this API method will have no effect.

    For information about pausing and resuming a replay, refer to NewRelic.pauseReplay()

    Use Cases

  • You want to manually trigger a replay to record on certain site pages or under certain conditions, regardless of the sampling settings.

    Example

    Here's an example of forcing a replay to start recording.

    Java

public class MainActivity extends Activity {
...
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.record_replay:
NewRelic.recordReplay();
...
return true;
default:
return super.onOptionsItemSelected(item);
}
}
...
}

Kotlin

class MainActivity : AppCompatActivity() {
...
var client: OkHttpClient = OkHttpClient();
binding.fab.setOnClickListener { view ->
NewRelic.recordReplay()
}
}
...

Syntax

Objective-c

Swift

Syntax

NewRelic.recordReplay()

Requirements

  • React Native v1.7.0 or higher.

    Description

    NewRelic.recordReplay() can be called to manually force a replay to begin recording. You must meet the following requirements:

  • Account is entitled to record replays

    If a replay is already in progress, or not all of the above criteria are met, this API method will have no effect.

    For information about pausing and resuming a replay, refer to NewRelic.pauseReplay()

    Use Cases

  • You want to manually trigger a replay to record on certain site pages or under certain conditions, regardless of the sampling settings.

    Example

    Here's an example of forcing a replay to start recording.

NewRelic.recordReplay();
Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.