I import an existing project into eclipse, and always encountered this problem. First, it appears the error: R cannot be solved. After import android.R. the error turned to the following methods. "start cannot be or is not a field"
I also checked the gen folder, where contains a R.java file. The file looks good, including the following contents: I also tried to clear the project and rebuilt which didnot work. Does any body have any idea how to solve this? Thanks a lot.
R.java:
public static final class layout {
public static final int kbd=0x7f030000;
public static final int main=0x7f030001;
public static final int start=0x7f030002;
}
startactivity.java:
import android.R;
import android.R.layout;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
public class StartActivity extends Activity {
Intent mMain;
/** Called when the activity is first created. */
/* (non-Javadoc)
* @see android.app.Activity#onCreate(android.os.Bundle)
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.start);//where error appears**
}
public void onStartButtonClick(View v) {
mMain = new Intent(this, MainActivity.class);
startActivity(mMain);
}