Basically my code is:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//connect to server
//get current map scope
//get media within map scope + a bit
//init and show map
setContentView(R.layout.main);
//add zoom controls
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
//add menu
}
Exceptions:
05-16 15:13:05.204: ERROR/AndroidRuntime(726): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.diretto.client.smartphone.android/org.diretto.client.smartphone.android.AnDiretto}: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread.access$1800(ActivityThread.java:112)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.os.Looper.loop(Looper.java:123)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread.main(ActivityThread.java:3948)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at java.lang.reflect.Method.invoke(Method.java:521)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at dalvik.system.NativeStart.main(Native Method)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.createView(LayoutInflater.java:512)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:309)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.Activity.setContentView(Activity.java:1626)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at org.diretto.client.smartphone.android.AnDiretto.onCreate(AnDiretto.java:39)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): ... 11 more
05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: java.lang.reflect.InvocationTargetException
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.google.android.maps.MapView.<init>(MapView.java:237)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at java.lang.reflect.Constructor.constructNative(Native Method)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at android.view.LayoutInflater.createView(LayoutInflater.java:499)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): ... 21 more
05-16 15:13:05.204: ERROR/AndroidRuntime(726): Caused by: java.lang.IllegalStateException: You are only allowed to have a single MapView in a MapActivity
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.google.android.maps.MapActivity.setupMapView(MapActivity.java:180)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.google.android.maps.MapView.<init>(MapView.java:279)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): at com.google.android.maps.MapView.<init>(MapView.java:254)
05-16 15:13:05.204: ERROR/AndroidRuntime(726): ... 25 more
XML file line 6 would be:
<com.google.android.maps.MapView android:id="@+id/mapview" ...
followed by other lines of XML-parameters