swatikch

InfoTemplate doesn't work when tapped on Graphic

Discussion created by swatikch on Dec 27, 2011
Latest reply on Jan 6, 2012 by aagarwal-esristaff
When I tap on any graphic, it's InfoTemplate doesn't show up. Following is the snippet of code showing how I am creating the Graphic and setting it's parameters.

     /*
      * Here, I am getting the results from the QueryTask (in FeatureSet queryResult)
      */
     Graphic graphics[] = queryResult.getGraphics();
     Symbol symbol = new PictureMarkerSymbol(getResources()
      .getDrawable(R.drawable.xyz));
     InfoTemplate infoTemplate = new InfoTemplate("Address",
     (String) graphics[0].getAttributeValue(queryResult
       .getDisplayFieldName()));

     Graphic gr = new Graphic(graphics[0].getGeometry(), symbol, graphics[0].getAttributes(), infoTemplate);
     GraphicsLayer gLayer = new GraphicsLayer();
     gLayer.addGraphic(gr);

If anyone came across this problem or has any suggestion on resolving this issue, please respond to this thread.

Thanks.

Outcomes