Modified for Main Thread, In order to run on the device with Android 4.0.