I am trying to create a simple button example, but when I add this code:
mButton = (Button) findViewById(R.id.button1);
it wont update my R.id file. I've tried everything including making sure automatic build is on, cleaning the project, and updating the SDK. This happens in both 1.6 and 2.2 projects.
Here's what full code is looking like:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class NewTest extends Activity {
Button myButton;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
myButton = (Button) findViewById(R.id.button1);
}
}