How do I declare "Member Fields" in Java?
<p>This question probably reveals my total lack of knowledge in Java. But let me first show you what I thought was the correct way to declare a "member field":</p>

<pre><code>public class NoteEdit extends Activity {

private Object mTitleText;
private Object mBodyText;
</code></pre>

<p>I'm following a google's notepad tutorial for android (<a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex2.html" rel="nofollow">here</a>) and they simply said: "Note that mTitleText and mBodyText are member fields (you need to declare them at the top of the class definition)." I thought I got it and then realized that this little snippet of code wasn't working.</p>

<pre><code>if (title != null) {
            mTitleText.setText(title);
        }
        if (body != null) {
            mBodyText.setText(body);
        }
</code></pre>

<p>So either I didn't set the "member fields" correctly which I thought all that was needed was to declare them private Objects at the top of the NoteEdit class or I'm missing something else. Thanks in advance for any help.</p>

<p><strong>UPDATE</strong></p>

<p>I was asked to show where these fields were being intialized here is another code snippet hope that it's helpful...</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.note_edit);
    Long mRowId;
    mTitleText = (EditText) findViewById(R.id.title);
    mBodyText = (EditText) findViewById(R.id.body);
</code></pre>

<p>So basically the error that is showing up is coming from eclipse:
"The method setText(String) is undefined for the type Object"</p>
