-1

How can I get the value of the object@notificationTextParams[0].id as a string? Debug

c1scok1d
  • 57
  • 1
  • 9
  • `SimpleGeofence` should override the `toString` method. And what would it mean for you to print its value? I see a lot of fields in that object. What would you print? – Federico klez Culloca Mar 10 '21 at 19:26
  • @FedericoklezCulloca, I'm simply trying to print, in this example "DNA Styles" – c1scok1d Mar 10 '21 at 19:43
  • Ok, but we have no idea what the `SimpelGeofence` class is. If it's a class you wrote, see the duplicate target about how to implement the `toString` method. If it's not a class you made, maybe it has a `getId` method that returns just that? – Federico klez Culloca Mar 10 '21 at 19:44
  • @FedericoklezCulloca simpleGeofence.getId() was my original attempt but it returns null. There's a string variable called 'foo' that I used to verify that. Yet as best as I can tell, it has a value. See screenshot... https://imgur.com/a/hOXkTK7 – c1scok1d Mar 10 '21 at 19:52

1 Answers1

-2
@Override
public String toString(){
return **whatever you**

This way you override the standard toString method printing the allocated data location.

Malthe22
  • 15
  • 8