Adapted to new api from android-library