And it gets added to the map correctly. But when I try to get popupinfo from the layer the result is always null so in the below line p is always null:
ArcGISPopupInfo p=fLayer.getPopupInfo();
What am I doing wrong? How do I get popupinfo from a feature layer?