added Java code to switch between activities