Hi guys, I am a beginner in programming with Java Android.
I am currently confused with how to enable button to work in Android 2.1
My current project requires a lot of different activities to work together in one program.
Let's say I have abutton inside the main.xml and assume the function inside ButtonAdroid.class is the one below:
public class ButtonAndroid extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button = (Button) findViewById(R.id.button_id);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Perform action on click
}
});
}
}
My goal is to make connection between the ButtonAndroid.class to another class, let's say its name is NextPage.java.
Do you guys know what kind of commands do I need to put inside "public void onClick(View v)" that will enable to transfer the current activity to NextPage.java?
Thank you so much.