I\'m new in the android develop world. I created simple application and created a simple GUI with one button. If the user presses this button, I want to change the screen
A better word than "Screen" is "Activity", You switch between Activities in android.
A very simple way is to create a button on one activity (Lets call this First Activity) and assign it a method like onClick = startSecondActivity in the .xml file.
Open FirstActivity.java, Add the method startSecondActivity inside the main method as shown below. This will work!
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the content of the activity to use the activity_main.xml layout file
setContentView(R.layout.activity_main);
}
public void startSecondActivity(View view){
Intent i = new Intent(this, SecondActivity.class);
startActivity(i);
}
}