2 messages in com.googlegroups.android-beginnersRe: problems with "layout_below" or IDs?| Subject: | Re: problems with "layout_below" or IDs?![]() |
|---|---|
| From: | Robert (fero...@gmail.com) |
| Date: | 02/28/2008 10:57:00 AM |
| List: | com.googlegroups.android-beginners |
I just learned that the M5 release of the SDK comes with the syntax change for IDs in XML files, so they now should be written as android:id= instead of just id, like the example suggests. I changed the syntax, and now the views appear as they should.
But, if there are so many changes between the API versions, how do we know which version are the examples based on?
Here are the changes, for those who don't know: http://code.google.com/android/migrating/m3-to-m5/m5-api-changes.html
Robert
On Feb 28, 1:07 pm, Robert <fero...@gmail.com> wrote:
Hello all,
I just started experimenting with Android, and I am quite new to Java and Eclipse, although have extensive programming experience in other OO languages. I am trying to test out the examples, writing the code in Eclipse and running it in the emulator. I have a problem with this:
http://code.google.com/android/devel/ui/xml.html
I created the main.xml file, modified the Java code to include this line in onCreate(): setContentView(R.layout.main);
But, when I view it in the emulator, all the views (TextView, EditText and Buttons) are displayed on the same line. EditText is placed over TextView, and the buttons are on EditText (on its left and right). It is like "layout_below" is not taken into account (or the IDs not found?). When I look at main.xml in Eclipse I see little yellow warning signs (!) at the left of the screen, with this text:
"found plain 'id' attribute; did you mean the new 'android:id' name?"
Maybe there is something wrong with the IDs? I use Eclipse v. 3.3.1.1, JDK 5 and android-sdk_m5-rc14_windows. Any help would be appreciated.
Thanks and regards, Robert
P.S. BTW, in the example " is a missing at the end of this line: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/




