Hi,

public void onClick(View view) {
                nametext = (EditText) findViewById(R.id.nametextxml);
                name = (String) nametext.getText().toString();

try  your code like this hopefully it will work.call findViewById with
the dialog refrence as under.

nametext = (EditText)dialog. findViewById(R.id.nametextxml);

Regards,
Gulfam

On Feb 16, 6:34 am, Faber Fedor <faberfe...@gmail.com> wrote:
> On Sat, Feb 14, 2009 at 1:01 AM, Noam <noam.ha...@gmail.com> wrote:
> > Whenever I run this code, it gives me NullPointerException. I know
> > that this line is the problem:
>
> >                trackname = (String) tracknametext.getText().toString();
>
> That is the correct way (although I think the cast is superflous).  Since
> you haven't posted any code that involves these variables, we can't say
> anything more.
>
>
>
> > Why is this happening? What's the correct way to convert this to a
> > String?
>
> I think you should be looking at why your tracknametext is a NullPointer.
>
> --
> Faber Fedor
> Linux New Jerseyhttp://linuxnj.com
--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to