Syntax
NewRelic.endInteraction(string $interactionID)
Ends a custom interaction.
Requirements
Compatible with all agent versions.
Description
New Relic ends all interactions automatically, but you can use endInteraction()
to end a custom interaction early. The string ID is returned when you use the startInteraction()
call.
This call has no effect if the interaction has already ended.
For general info on using this API, see the Android SDK API usage guide.
Parameters
Parameter | Description |
---|---|
string | Required. The string ID for the interaction you want to end. This string is returned when you use |
Examples
End an interaction
Here's an example of ending a custom interaction RefreshContacts
:
public class MainActivity extends Activity { ... @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_refresh: String interactionId = NewRelic.startInteraction("RefreshContacts"); ... return true; default: NewRelic.endInteraction(interactionId); return super.onOptionsItemSelected(item); } } ...}
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.