I was defining it as
String imageFileName = null
I guess I should have been donig imageFileName="" was not thinking.

Chris.

On May 17, 3:15 am, Mariano Kamp <[email protected]> wrote:
> You need to paste a bigger code sample then. The question would be then how
> comes that imageFileName is null? You need to paste at least the part where
> a value should have been assigned to it.
>
>
>
> On Sun, May 17, 2009 at 6:21 AM, chrispix <[email protected]> wrote:
>
> > Can you explain how it worked up until now? Maybe the file naming on
> > the camera has changed?
>
> > On May 16, 8:12 pm, Dianne Hackborn <[email protected]> wrote:
> > > Seriously, this never ever worked:
>
> > > String imageFileName;
> > > String theString = imageFileName.toString().
>
> > > Calling toString() on a null object has always and will always result in
> > a
> > > NullPointerException.
>
> > > On Sat, May 16, 2009 at 2:41 PM, chrispix <[email protected]> wrote:
>
> > > > Actually it did work prior to 1.5, it appears it has been fixed. You
> > > > should give it a
> > > > whirl! Thanks for the heads up on that.. Trying to make the migration
> > > > from .NET to
> > > > Java and some things that appeared like they would work apparently
> > > > have changed
> > > > some.
>
> > > > Thanks again!
>
> > > > Chris
>
> > > > On May 16, 1:02 am, Romain Guy <[email protected]> wrote:
> > > > > It couldn't have been working before 1.5. The only way to safely
> > > > > convert an object to a String without a NullPointerException is to
> > use
> > > > > a StringBuilder/StringBuffer or use a String concatenation:
>
> > > > > String imageFileName = "" + myFile.imageFileName;
>
> > > > > Or better yet, explicitly check for null :)
>
> > > > > On Fri, May 15, 2009 at 10:10 PM,chrispix<[email protected]> wrote:
>
> > > > > > if the value of imageFileName is null, why can I not change null
> > into
> > > > > > a string? It was working before 1.5.
> > > > > > String imageFileName = myFile.imageFileName.toString();
>
> > > > > > This gives me the a NullPointerException Error.
>
> > > > > --
> > > > > Romain Guy
> > > > > Android framework engineer
> > > > > [email protected]
>
> > > > > Note: please don't send private questions to me, as I don't have time
> > > > > to provide private support.  All such questions should be posted on
> > > > > public forums, where I and others can see and answer them
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > [email protected]
>
> > > Note: please don't send private questions to me, as I don't have time to
> > > provide private support, and so won't reply to such e-mails.  All such
> > > questions should be posted on public forums, where I and others can see
> > and
> > > answer them.- Hide quoted text -
>
> > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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