Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Development : id cannot be resolved or is not a field
    primarykey
    data
    text
    <p>So I just started Android development, and I've already hit a wall. I have been looking around a whole lot online and on this website, but can't seem to find an answer that works for me. All I have written down so far in my Activity file is the following.</p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.widget.Button; public class CommanderActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button button = (Button) findViewById( R.id.button_id ); } } </code></pre> <p>It is in the last line of code ( R.id.button_id ) where the error arises. My XML file looks like this: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" &gt; &lt;TableRow&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="match_parent" android:text="@string/Parameters" android:onClick="openParameters" /&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="match_parent" android:text="@string/Waves" android:onClick="openWaves" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/MoreParameters" android:onClick="openMoreParameters" /&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/Status" android:onClick="openStatus" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/Operations" android:onClick="openOperations" /&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/Monitor" android:onClick="openMonitor" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/CEBus" android:onClick="openCEBus" /&gt; &lt;Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/Advanced" android:onClick="openAdvanced" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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