Hehe,
yep, that's the most common error beginers make when start with
android and i already mentioned it in my post above ^^

On Mar 26, 2:41 pm, Lovedumplingx <lovedumpli...@gmail.com> wrote:
> Holy Mother Dogfood!!!
>
> I am quite possibly an idiot (that's the second time I'm saying this
> today)!  Wow.  So simple and yet I was looking at it all backward.
>
> Thanks so much.  It makes sense now.
>
> On Mar 25, 4:34 pm, Mark Murphy <mmur...@commonsware.com> wrote:
>
>
>
> > Lovedumplingx wrote:
> > > So I see the NullPointer Exception as a good starting point but I'm
> > > still perplexed.
>
> > > I created a new project just for testing. And I can't get this to
> > > work:
>
> > > package com.test;
>
> > > import android.app.Activity;
> > > import android.os.Bundle;
> > > import android.widget.EditText;
>
> > > public class main extends Activity {
> > >     /** Called when the activity is first created. */
> > >     EditText justFillIn;
>
> > >   �...@override
> > >     public void onCreate(Bundle savedInstanceState) {
> > >         super.onCreate(savedInstanceState);
>
> > >         justFillIn = (EditText) findViewById(R.id.ipText);
> > >         justFillIn.setText("charSequence is a string");
>
> > >         setContentView(R.layout.main);
> > >     }
> > > }
>
> > > All I want to do is set the value for that EditText and it's just not
> > > working.
>
> > You must call setContentView() first.
>
> > You aren't telling Android what layout to display until you call
> > setContentView(). Hence, until that time, findViewById() is guaranteed
> > not to work, because there are no views to find.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html- Hide quoted 
> > text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to