package com.example.hello.word; import android.R; import android.app.Activity; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ToggleButton; public class OptionsMenu extends Activity{ MediaPlayer ourSong; Button btn1; Intent openStartingPoint; @Override protected void onCreate(Bundle savedInstanceState) {
I have an error under all the buttons, and this shows me, for example: "menuoptions cannot be allowed or not a field." same error on togglebutton1
my xml file:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="Volume" android:textSize="40dp" android:textStyle="bold" android:layout_marginTop="40dp" android:textAppearance="?android:attr/textAppearanceLarge" /> <ToggleButton android:id="@+id/toggleButton1" android:layout_width="121dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="20dp" android:text="ToggleButton" /> <Button android:id="@+id/button1" android:layout_width="178dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="150dp" android:text="Back" /> </LinearLayout>
I tried to clear the project .. delete the class R and all that! What can I do to fix this error? Thanx for helpers ..
source share