when a button is pushed i want to activate another activity what is my problem???
Posted
by yoavstr
on Stack Overflow
See other posts from Stack Overflow
or by yoavstr
Published on 2010-05-24T13:30:20Z
Indexed on
2010/05/24
14:01 UTC
Read the original article
Hit count: 222
android
|android-widget
package com.countryCityGame;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class countryCityGameMenu extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button aboutButton = (Button) this.findViewById(R.id.aboutButton);
Button exitButton = (Button) this.findViewById(R.id.exitButton);
Button newGameButton = (Button) this.findViewById(R.id.newGameButton);
newGameButton.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
startActivity(new Intent(this,GameScreen.class));
}
});
}
}
© Stack Overflow or respective owner