Я не считаю себя новичком, но моя копия и вставка оставили меня в автогенерированных ошибках. Вот моя дилемма, если я удалю комментарии ниже, программа неожиданно аварийно; с комментариями он отображается просто отлично.findViewById() question
//////// Options.java /////
public class Options extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reclayout);
//Button STO = (Button)findViewById(R.id.StopBut);
//Button REC = (Button)findViewById(R.id.RecButton);
}
}
///////reclayout.xml/////
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<Spinner
android:id="@+id/Spinner01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:contentDescription="Classes"/>
<EditText
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:lines="3"
android:id="@+id/DescriptionText"
android:text="Class Description"/>
<LinearLayout
android:layout_height="wrap_content"
android:id="@+id/ButtonLayout"
android:orientation="horizontal"
android:layout_width="fill_parent">
<ImageButton
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3"
android:id="@+id/RecButton"
android:focusableInTouchMode="true"
android:src="@drawable/rec"/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3"
android:id="@+id/PauseButton"
android:src="@drawable/pause"/>
<ImageButton
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_weight="3"
droid:src="@drawable/stop"
android:id="@+id/StopBut"/></LinearLayout></LinearLayout>`
Что значит «неожиданно»? У вас есть трассировка стека? –