Friday, June 3, 2011

Re: [android-developers] Error getting MapView instance

On Wed, Jun 1, 2011 at 8:57 AM, Ale2011 <das2010@gmail.com> wrote:
When I tried to generate an instance of MapView with (MapView)
findViewById(R.id.mapview), it returns NULL.

Your activity can't return a View that has not been added to it, now can it?
Call setContentView(R.id.main) BEFORE calling findViewById(R.id.mapview).

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment