the problem is that you have to call "setContentView(R.layout.main)"
_before_ you can access the layout objects by ID. Otherwise, a call like
"findViewById(R.id.LinearLayout01)" (or R.id.mapView) will always return
null.
I have copied the source code that you provided into a new test
application, moved the setContentView() call to the top and it was
working. You may create the MapView either programatically via "new
MapView(...)" or in your XML layout file, both methods should work.
You can look at the source code of our "AdvancedMapViewer" demo
application to see an example how we work with XML layout files. The
Android application is in our repository in the following subdirectory:
trunk/Applications/Android/AdvancedMapViewer
By the way ... if you are using the MapView in a "download" mode, make
sure that your application has the permission to access the Internet.
For that you need to have the following line in your Manifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
Best regards,
Thilo
--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.