This is my first post here. Have done hundreds of posts, mostly answers, in linuxquestions.org, but nothing here yet. I'm starting to develop using android SDK 1.2, and struggle to understand something.
I've used a basic source that uses xml to define a UI and gets it displayed using setContentView(R.layout.main);.
Now in my Java program I'd like to add some code to modify some of the objects I defined in my xml file.
I understand Java, the object concept, methods, etc ... but I don't know which exact syntax to use, and which id my object actually is.
My xml code includes:
<EditText android:layout_width="match_parent" android:id="@+id/editText1" android:layout_height="wrap_content" android:text="@string/saisie">
<requestFocus></requestFocus>
</EditText>
my .java includes:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
My question is: how do I modify the .java code to make the EditText object display "hello" instead of what is statically defined in my strings file?
I know there is not a big practical use in the example code I am doing, but it will help me do lots of other more interesting things.