I'm making an app and when it launches it starts Mainactivity.java Mainactivity.java opens a layout with 9 Imagebuttons. How can I implement in my code in Mainactivity.java that once one is clicked it opens another activity (like telefoonnummers.java)? Sorry for my bad English but I'm dutch and a non-native speaker. I have this code in Mainactivity.java:
package com.example.rome;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.EditText;
import android.widget.Button;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Very clean as you see, but how can I add the implementation, would you guys please help??? My Imagebuttons are all just called imagebutton1, imagebuttton2 etc. btw.