1

I'm creating an Android application to display shapefiles. I'm using this code that I found on the Internet:

try {
        ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable("file:///mnt/sdcard/ShapeFile/LVA_water_lines_dcw.shp");
        FeatureLayer featureLayer = new FeatureLayer(shapefileFeatureTable);
        featureLayer.setRenderer(new SimpleRenderer(new SimpleFillSymbol(
                getResources().getColor(android.R.color.holo_blue_bright),
                SimpleFillSymbol.STYLE.SOLID)));
        map.addLayer(featureLayer);
    } catch (FileNotFoundException ex) {
        //Toast.makeText(this, R.string.shapefile_not_found, Toast.LENGTH_LONG).show();
        ex.printStackTrace();
        return;
    }

But it gives me the error:

ShapefileFeatureTable cannot be converted to FeatureTable
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
WhizBoy
  • 21
  • 6

1 Answers1

1

I had a wrong import.

import com.esri.arcgisruntime.layers.FeatureLayer;

instead of

import com.esri.android.map.FeatureLayer;
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
WhizBoy
  • 21
  • 6