POST
|
I followed the instructions in "Upgrade ArcGIS Projects to SDK 1.1". When I run my project I get the following runtime exceptions. Whatever I did, I could not fix the problem. java.lang.RuntimeException: Unable to start activity ComponentInfo{xx.xx.xx/xx.xx.xx.pages.MapPage}: android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.MapView android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.MapView Caused by: java.lang.ClassNotFoundException: com.esri.android.map.MapView in loader dalvik.system.PathClassLoader[/data/app/xx.xx.xxx.apk] Try to go to project properties - java build path - libraries, Remove arcgis libraries, Press button "add library" and chose "arcgis for android library container".
... View more
04-10-2012
01:37 AM
|
0
|
0
|
941
|
POST
|
If ???Apply Edits??? method used on second Feature Layer, then after pausing and resuming the application, features load, but don???t appear.
public class BlablaESRIActivity extends Activity {
public MapView mapView;
BingMapsLayer tLayer = null;
ArcGISFeatureLayer fLayer = null;
ArcGISFeatureLayer logTable = null;
Graphic currentGraphic = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
mapView = (MapView)findViewById(R.id.mapview);
mapView.setOnStatusChangedListener(mapOnStatusChangedListener);
tLayer = new BingMapsLayer("vjhadbfabsdffv...", MapStyle.Road);
mapView.addLayer(tLayer);
mapView.setOnSingleTapListener(mapOnSingleTapListener);
}
@Override
protected void onDestroy() {
super.onDestroy();
mapView.recycle();
}
@Override
protected void onPause() {
super.onPause();
mapView.pause();
}
@Override
protected void onResume() {
super.onResume();
mapView.unpause();
}
private OnStatusChangedListener mapOnStatusChangedListener = new OnStatusChangedListener() {
private static final long serialVersionUID = 1L;
public void onStatusChanged(Object source, STATUS status) {
if (source == mapView && status == STATUS.INITIALIZED) {
fLayer = new ArcGISFeatureLayer("http://.../ArcGIS/rest/services/POIs/FeatureServer/0",MODE.ONDEMAND);
mapView.addLayer(fLayer);
logTable = new ArcGISFeatureLayer("http://.../ArcGIS/rest/services/POIs/FeatureServer/1", new Options(),c);
}
}
};
private OnSingleTapListener mapOnSingleTapListener = new OnSingleTapListener() {
private static final long serialVersionUID = 1L;
public void onSingleTap(float x, float y) {
if (currentGraphic == null) {
int[] graphicIDs = fLayer.getGraphicIDs(x, y, 20);
if (graphicIDs == null) return;
if (graphicIDs.length == 0) return;
currentGraphic = fLayer.getGraphic(graphicIDs[0]);
} else {
Point p = (Point) currentGraphic.getGeometry();
p.setXY(mapView.toMapPoint(x, y).getX(), mapView.toMapPoint(x, y).getY());
saveCurrentPOI();
}
}
};
public void saveCurrentPOI() {
if (currentGraphic == null) return;
fLayer.applyEdits(null, null, new Graphic[] { currentGraphic }, null);
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("LANDMARK_NAME", "name");
attributes.put("LANDMARK_X", ((Point) currentGraphic.getGeometry()).getX());
attributes.put("LANDMARK_Y", ((Point) currentGraphic.getGeometry()).getY());
Graphic newLogRecord = new Graphic(null, null, attributes, null);
//If ???Apply Edits??? method used on this Feature Layer, then after pausing and resuming the application, fLayer points load, but don???t appear.
logTable.applyEdits(new Graphic[] { newLogRecord }, null, null, null);
currentGraphic = null;
}
}
... View more
04-09-2012
06:32 AM
|
0
|
1
|
923
|
POST
|
fLayer = new ArcGISFeatureLayer("http://.../ArcGIS/rest/services/POIs/FeatureServer/0",o,c);
fLayer.setRenderer(new SimpleRenderer(new PictureMarkerSymbol(getResources().getDrawable(R.drawable.ic_one))));
Pictures appear sometime, but usually black points ---------
fLayer = new ArcGISFeatureLayer("http://.../ArcGIS/rest/services/POIs/FeatureServer/0",o,c);
UniqueValueRenderer renderer = new UniqueValueRenderer();
renderer.setDefaultSymbol(new PictureMarkerSymbol(getResources().getDrawable(R.drawable.ic_one)));
renderer.setField1("TYPE");
for (int i = 0; i < 17; i++) {
UniqueValue uniqueValue = new UniqueValue();
uniqueValue.setValue(new Object[] {i+1});
uniqueValue.setSymbol(new PictureMarkerSymbol(getResources().getDrawable(R.drawable.ic_two)));
renderer.addUniqueValue(uniqueValue);
}
fLayer.setRenderer(renderer);
If UniqueValue set not for every possible value - pictures appear sometime, but usually black points. Work fine only when UniqueValue set for each value.
... View more
04-09-2012
05:14 AM
|
0
|
0
|
483
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|