• /
  • Log in
  • Free account

setInteractionName (Android SDK API)

Syntax

NewRelic.setInteractionName(string $interactionName)

Set a new name for an interaction that is already being tracked by New Relic.

Requirements

Compatible with all agent versions.

Description

Use setInteractionName() to change the name of an interaction in an instrumented app.

For example, you have an interaction that is being reported under a single activity name, like FragmentActivity, or under an obfuscated name, like baseclass.a, and you want to rename the interaction to be more descriptive,. You could use setInteractionName at the beginning of each onCreate() method to change the name.

To create a new interaction, see startInteraction().

For general info on using this API, see the Android SDK API usage guide.

Parameters

Parameter

Description

$interactionName

string

Required. The name you want to give to the interaction.

Examples

Name an interaction

This example uses NewRelic.setInteractionName() at the beginning of the onCreate() method as part of the Activity class.

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
//Rename the in-flight interaction
NewRelic.setInteractionName("Display MyCustomInteraction");
}
// ... continue methods ...
}
Create issueEdit page
Copyright © 2022 New Relic Inc.