Updated to work in latest Android Studio