title: draw icon from database
body: <p>ok i try to draw icon from database in a map... but i have null pointer exception..</p>
  
  <p>i do this ..</p>
  
  <pre><code>public enum icon { lake }
  </code></pre>
  
  <p>[....]
       public class POI implements Serializable
       {
       private static final long serialVersionUID = -8618762943599351669L;</p>
  
  <pre><code>private long id;
  private String name;
  private double longitude;
  private double latitude;
  private boolean visible = true;
  public static  String icon;
  private String info;
  
  public POI(long id, String name, double longitude, double latitude, boolean visible, String icon, String info)
  {
      this(id, name, longitude, latitude, visible, icon, info, true);
  }
  
  public POI(long id, String name, double longitude, double latitude, boolean visible, String icon, String info, boolean b)
  {
      this.id = id;
      this.name = name;
      this.longitude = longitude;
      this.latitude = latitude;
      this.visible = visible;
      POI.icon = icon;
      this.info = info;
  }
  
  void initOverlays()
  {
      Map&lt;icon, Bitmap&gt; markersIcons = new HashMap&lt;icon, Bitmap&gt;();
      Bitmap posMarker = BitmapFactory.decodeResource(getResources(), R.drawable.marker);
      Bitmap pathMarker = BitmapFactory.decodeResource(getResources(), R.drawable.dest);
      Bitmap church = BitmapFactory.decodeResource(getResources(), R.drawable.church); 
      TilesManager tilesManager = mapView.getTilesManager();
  
  
  
      tracksOverlay = new TracksOverlay(this, tilesManager);
      positionMarkerOverlay = new PositionMarkerOverlay(tilesManager, posMarker);
      markersIcons.put(icon.church, church); 
      poiOverlay = new POIOverlay(tilesManager, this,  markersIcons);
  
  
      pathOverlay = new PathOverlay(tilesManager, pathMarker);
  
      mapView.addOverlay(tracksOverlay);
      mapView.addOverlay(poiOverlay);
      mapView.addOverlay(positionMarkerOverlay);
      mapView.addOverlay(pathOverlay);
  
      StateManager.restoreTracksOverlayState(this, tracksOverlay);
      StateManager.restorePOIOverlayState(this, poiOverlay);
      StateManager.restorePathOverlayState(this, pathOverlay);
  }
  </code></pre>
  
  <p>after i draw icon from database i get in "lake" in colums of icon..</p>
  
  <pre><code>public POIOverlay(TilesManager tilesManager, Context context,Map&lt;icon, Bitmap&gt; poiMarker)
  {
      super(tilesManager);
  
      this.context = context;
  
   this.setPoiMarker(poiMarker);
      textPaint.setColor(Color.BLACK);
      textPaint.setTextSize(15);
  }
  
  @Override
  protected void drawOverlay(Canvas canvas, int x, int y)
  {
      for (POI poi : points)
      {
          if (!poi.isVisible()) continue;
  
          Point poiPos = tilesManager.lonLatToPixelXY(poi.getLongitude(), poi.getLatitude());
          int finalX = poiPos.x + x;
          int finalY = poiPos.y + y;
          Bitmap marker = markersIcons.get(POI.icon);
  
  
          canvas.drawBitmap(marker, finalX - marker.getWidth() / 2, finalY - marker.getHeight() / 2, bitmapPaint); 
          canvas.drawText(poi.getName(), finalX - marker.getWidth() / 2, finalY, textPaint);
      }
  }
  </code></pre>
  
  <p>But i have null pointer from POI.icon i make breakpoints to debug and poi.icon is null not read string from database... why???? Need help!!</p>