modified Activity.java