This crashes my app:Java: Mapscreen
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
// Initial activity content view. (START)
super.onCreate(savedInstanceState);
setContentView(R.layout.mapscreen);
// Retrieve the map layout and initial extent from mapscreen XML layout.
map = (MapView) findViewById(R.id.map);
// Add ESRI basemap layer to MapView.
map.addLayer(new ArcGISTiledMapServiceLayer("" +
"http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"));
// Add Facility Feature layer to the MapView
String URL = "http://PUT YOUR SERVER INFO HERE/ArcGIS/rest/services/Mobile/PUT YOUR MAP SERVICE HERE";
ArcGISFeatureLayer fLayer = new ArcGISFeatureLayer(URL, MODE.ONDEMAND);
map.addLayer(fLayer);
// This puts the ERSI logo on the bottom left corner of the screen once the map screen appears.
map.setEsriLogoVisible(true);
}
//Check Box Setup
public void onCheckboxClicked(View view) {
// Is the view now checked?
boolean checked = ((CheckBox) view).isChecked();
// Check which checkbox was clicked
switch(view.getId()) {
case R.id.checkBox1:
if (checked)
fLayer.setVisible(true);
else
fLayer.setVisible(false);
break;
}
}
XML: mapscreen
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/app_frame"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent="-9246560.42264577, 3775709.72082467, -8746857.60892366, 4180002.76740144" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="77dp"
android:layout_height="54dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:src="@drawable/logo_white" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:onClick="onCheckboxClicked"
android:text="WORK!!!!!" />
</RelativeLayout>