Even i got same Error but i rebuild the r.java also but no use getting same error
this is my Sudoku.java
if i remove android.R i get error at each button element in the below phrase.
package com.wipro.sudokuActivity;
import android.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;;
public class Sudoku extends Activity implements OnClickListener
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
/** set up click listeners for all buttons */
View continueButton = this.findViewById(R.id.button1);
continueButton.setOnClickListener(this);
View newButton = this.findViewById(R.id.button2);
newButton.setOnClickListener(this);
View instructionButton = this.findViewById(R.id.button3);
instructionButton.setOnClickListener(this);
View exitButton = this.findViewById(R.id.button1);
exitButton.setOnClickListener(this);
}
public void onClick(View v) {
switch (v.getId()) {
case R.id.button3:
Intent i = new Intent(this, Instructions.class);
startActivity(i);
break;
}
}
}
this is Instructions.java file
here also r.layout .main cant be resolved ..
by aim is to create a button .when user clicks on dat button it should give description of that game....
package com.wipro.sudokuActivity;
//import android.R;
import android.app.Activity;
import android.os.Bundle;
public class Instructions extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.instructions);
}
}
this is my main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android
rientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background"
android:gravity="center"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/Main_Title"
android:textSize="15pt"
android:layout_marginBottom="25dip"
/>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/first"
/>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/second"
/>
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/third"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/fourth"
android:id="button1"/>
</LinearLayout>
this is my instuctions .xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android
adding="10dip">
<TextView android:id="@+id/instructions_content"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="@string/Instructions_text" />
</ScrollView>
please let me know as early as possible ...i appreciate your reply