tags:

views:

38

answers:

2

Im creating a custom layout and I want to use the text declared in the layout.xml file in my layout.

Like when I create a TextView in XML and set android:text=@string/text1 when I run the app text view automatically loads the text from android:text. So how can I access attributes declared in the layout XML file in my custom component.

A: 

Did you complete the Android Developer Tutorials? The Hello, Views | Relative Layout tutorial will walk you through how to do this.

JackN
Never seen the answer to his question there. I would like if you could give the exact link if it exists.
Macarse
You are correct, it is in the Notepad Tutorial (http://developer.android.com/resources/tutorials/notepad), not the Hello, Views | Relative Layout tutorial, and the project exercises archive (.zip) containing the source is needed. An example of this question is covered in Notepadv2Solution, for example: mBodyText = (EditText) findViewById(R.id.body);
JackN
@JackN: Sorry, but I think you misunderstood his question.
Macarse
A: 

I have learn how to do it from this:

WebImageView: Buy one, get two!

In simple steps:

Macarse