As an example:

<RelativeLayout
    ...
    android:id="@+id/my_relative_layout_id"
    ...
/>

Then you would use setContentView(R.id.my_relative_layout_id);

Hope that helps...
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Mon, Jul 19, 2010 at 5:06 PM, Justin Anderson <janderson....@gmail.com>wrote:

> You need to specify an id in that method... and you need to set an id in
> your xml layout.
>
>
>
> ----------------------------------------------------------------------
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> ----------------------------------------------------------------------
>
>
> On Mon, Jul 19, 2010 at 3:51 PM, Bret Foreman <bret.fore...@gmail.com>wrote:
>
>> Didn't work:
>>
>>                setContentView(R.layout.main);
>>                View myView = findViewById( R.layout.main );
>>
>> myView comes back null. The R.layout.main resource works fine in the
>> Activity, by the way.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Beginners" group.
>>
>> NEW! Try asking and tagging your question on Stack Overflow at
>> http://stackoverflow.com/questions/tagged/android
>>
>> To unsubscribe from this group, send email to
>> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-beginners?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

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