Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid beginner tutorial Error parsing XML
    text
    copied!<p>I have just started the beginner's tutorial on android and I get 4 errors when compiling, even tho the code is basically copied from the webpage and I have followed all the steps. The errors are as follows:</p> <ul> <li>Element type "LinearLayout" must be followed by either attribute specifications, ">" or "/>". activity_main.xml /test/res/layout line 6 Android XML Format Problem</li> <li>R cannot be resolved to a variable MainActivity.java /test/src/com/example/test line 12 Java Problem</li> <li>R cannot be resolved to a variable MainActivity.java /test/src/com/example/test line 19 Java Problem</li> <li>error: Error parsing XML: not well-formed (invalid token) activity_main.xml /test/res/layout line 6 Android AAPT Problem]</li> </ul> <p>Here is the code: activity_main.xml</p> <pre><code> &lt;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" &lt;EditText android:id="@+id/edit_message" android:layout_width="0dp" android:layout_height="wrap_content" android:hint="@string/edit_message" android:layout_weight="1" /&gt; &lt;Button android:layout_width="wrap content" android:layout_height="wrap_content" android:text="@string/button_send" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>MainActivity.java</p> <pre><code> package com.example.test; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } </code></pre> <p>I searched everywhere, tried everything and it still won't work, so this is my last hope. Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload