AnsweredAssumed Answered

error in my first application

Question asked by s2mambau on Dec 12, 2013
Latest reply on Jul 23, 2014 by cagoscra
Hi, i new in this arcgis runtime SDk for android. i have this problem where i get 'ArcGISTiledMapServiceLayer cannot be resolved to a type' and need to add 'import com.esri.android.map.ags.ArcGISTiledMapServiceLayer;' in Activity.java to resolve the error. Here is my code. Did i do the right way?
Thank.

package com.esri.arcgis.android.samples.helloworld;

import android.app.Activity;
import android.os.Bundle;


import com.esri.android.map.MapView;
import com.esri.android.map.ags.ArcGISTiledMapServiceLayer;


public class HelloWorldActivity extends Activity {

MapView mMapView;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mMapView = new MapView(this);
// Retrieve the map and initial extent from XML layout
mMapView = (MapView)findViewById(R.id.map);
// Add dynamic layer to MapView
mMapView.addLayer(new ArcGISTiledMapServiceLayer("" +
"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));

}

@Override
protected void onDestroy() {
super.onDestroy();
}
@Override
protected void onPause() {
super.onPause();
mMapView.pause();
}
@Override
protected void onResume() {
super.onResume();
mMapView.unpause();
}

}

Outcomes