Added ProgressDialog logic in an Activity