This is my code:
<?xml version="1.0" encoding="utf-8"?>
LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message";
</EditText>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send";
</Button>
</LinearLayout>
There’s an error
at the first EditText and first Button lines, the first error being the one in the title, and the second one being:
‘Element type ‘EditText’ must be followed by either Attribute Specifications, ‘>’ or ‘/>’
What’s wrong? the whole code is made (almost) exactly as shown here http://developer.android.com/training/basics/firstapp/building-ui.html
(and i’m sorry if I misspelled or forgot anything, I’m a noob here…)
EDIT: Thanks, guys, but I tried pasting your code over mine. Though there are no X signs, the debug tool still says there are some errors…
EDIT: Yes, I have the needed strings, as I followed the tutorial. But I don’t understand… If I paste the code given on the tutorial’s site to Eclipse, there’s still an error! I’ll try opening the .xml in another program.
You must close your tags either with
/>in<EditText key="value" />or with>in<EditText key="value"></EditText>. Don’t use;Edit: After that, if you still have errors, remove:
and
unless you have corresponding entries inside your values/strings.xml file for them: