How can I had to class layout in R another XML file?
It should be automatic as I had new resources to res, but it's not. Someone knows what I did wrong?
I open an activity and now I want to open another activity that will work with another XML example. I have menu and main.xml. Now I want to go for another activity called gamescreen using this method:
newGameButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
Intent i = = new Intent(this, gameScreen.class);
startActivity(i);
}
}
I want to move to another "page" to another activity called gameScreen which should be associated to the XML called gameScreen.xml.
But in its onCreate:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gameScreen);
}
and gameScreen is not a member of the R file.
The main problem is that when I add resource to layout for example newxmlfile.xml the R file doesn't do any work and stays in this state.
public static final class layout {
public static final int main=0x7f030000;
}where it should have been:
public static final class layout {
public static final int main=0x7f030000;
public static final int newxmlfile=0x7f031000;
}