This is the error that I'm getting in first place when I'm debugging the application:
"com.esri.arcgisruntime.ArcGISRuntimeException:Cannot call this method in this context".
I must point out that I'm trying creating a new PopupDefinition because, when I create the feature layer from the feature table, according to the debugger it has no PopupDefinition set and it seems rare to me because in the browser I can see the pop-ups without problem like in the first image.