add logic to activity.java