Edit: NOT setContentView()....

The code would be:
findViewById(R.id.my_relative_layout_id);

Sorry about that...
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:07 PM, Justin Anderson <[email protected]>wrote:

> 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 
> <[email protected]>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 <[email protected]>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
>>> [email protected]<android-beginners%[email protected]>
>>> 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
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to