manurules3
Newbie
Hi, my name is Jamie, and I am an aspiring android app developer. I've read a few tutorials, ebooks, etc. and starting going around developing my first app, which is a game.
First of all, making the main menu for my game, i started to set up the about and how-to-play pages (by creating a separate class for each). Anyway, when in emulation, the about button works, but the how to play button does nothing when clicked. I double checked id's, activity names, and eclipse finds nothing wrong with my code. Here is the code for the activity as it deals to this problem.
Also, regarding game engine development, has anyone found any good ebooks or tutorials, because I am totally in the dark about that concept, and I am doing all the graphical and layout development before-hand, but I would life to start learning that part.
Thanks in advance,
Jamie
First of all, making the main menu for my game, i started to set up the about and how-to-play pages (by creating a separate class for each). Anyway, when in emulation, the about button works, but the how to play button does nothing when clicked. I double checked id's, activity names, and eclipse finds nothing wrong with my code. Here is the code for the activity as it deals to this problem.
Code:
public class Robot_Invasion extends Activity implements OnClickListener {
public void onClick(View v) {
switch(v.getId()){
case R.id.about:
Intent a = new Intent(this, About.class);
startActivity (a);
switch(v.getId()){
case R.id.help:
Intent h = new Intent(this, Howtoplay.class);
startActivity (h);
break;
}
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
View campaignButton = findViewById(R.id.campaign);
campaignButton.setOnClickListener(this);
View sandboxButton = findViewById(R.id.sandbox);
sandboxButton.setOnClickListener(this);
View howtoplayButton = findViewById(R.id.help);
howtoplayButton.setOnClickListener(this);
View aboutButton = findViewById(R.id.about);
aboutButton.setOnClickListener(this);
Thanks in advance,
Jamie