Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding id to TextView results error
    text
    copied!<p>Im new in developing apps for android. Ive got this piece of code (which is working fine) (it is part of layout/main.xml):</p> <pre><code>&lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; </code></pre> <p>and this code (which is not working well):</p> <pre><code>&lt;TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; </code></pre> <p>WTF, guys? If i run the second code I will receive "Sorry! The application x has stopped unexpectedly[...]" If I remove this text view at all it is also working well (i don't interact whit this TextView in my code. What is wrong whit this? </p> <p>Please help, Chris</p> <p>EDIT:</p> <p>This is my only method (it is only beginning of the project ;) )</p> <pre><code>@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Spinner s = (Spinner) findViewById(R.id.spinner); ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.days, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); s.setAdapter(adapter); } </code></pre> <p>and here is the rest of main.xml</p> <p> </p> <pre><code> &lt;TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/text2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="Wybierz dzień:" /&gt; &lt;Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="true" android:prompt="@string/day_prompt" /&gt; &lt;/LinearLayout&gt; </code></pre>
 

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