Faber Fedor wrote:
> This is odd.  I need to make my code pretty, so the first thing I want
> to do is to change the all the strings 'com.appspot.lbtdl' to
> 'com.faberfedor.tagyourworld'. I change every string in all the
> directories using the Perl 'pie' technique.  Then I put the code into a
> new directory, create a new Eclipse project and run it.
> 
> For some reason, my code now crashes with a NullPointerException in my
> MapView on the line
> 
>         map.getOverlays().add(new SitesOverlay(marker));
> 
> If I comment it out, the programs runs; wrongly, but it runs.  Both map
> and marker have values/content/attributes/whatever you say a non-null
> object has.
> 
> I've diffed every file in the project and the *only* thing different is
> the changing of my package name strings and the dir structure under src/.
> 
> Any ideas?

Various random ideas, and forgive me if you thought of these already:

1. Blow away R.java, assuming you copied it over with the rest of your
code, and rebuild.

2. I assume your code is in a new directory tree
(src/com/faberfedor/tagyourworld) that matches your namespace...right?

3. If you somehow copied over compiled classes when you set up your new
Eclipse project, get rid of those too and make sure it rebuilds all from
scratch.

4. Is the exception precisely on that line, or on a nested call? If it
is precisely on that line, and if map and marker are confirmed to exist,
then map.getOverlays() must be what's returning null.

5. Are you still inheriting from MapActivity?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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

Reply via email to