So, I am new to Android AND Java, so here is my entry to "the most easy question of the year" though it has been bugging me for a while now.
So I have created this TextView in my main.xml: (stripped from not-important info)
Using xml Syntax Highlighting
- <TextView id="@+id/answer"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:text="0"/>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
Now I want to do this: (stripped source)
Using java Syntax Highlighting
- public class Program extends Activity {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- R.id.answer.setText("something");
- }
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
However, eclipse gives me this:
Cannot invoke setText(String) on the primitive type int
And I don't seem to get the meaning of this error. Does anyone has an idea?





. Today I started working on tutorial 2 and tried to create my own app for the first time. And now its finished
.
