I do not know if this bug is in the code that I use to open the activity, or if it lies in the activity itself. This is the code for opening the activity, please tell me if I have an error in this, or if it is something else.
public void openGallery(View view){
Intent intent = new Intent(this, PhotoGallery.class);
startActivity(intent);
}