Replaced a string method that is undefined in api level 8, causing errors on Google Play