Removed deprecated method getPackageManager used to detect activity in
foreground. Modified minSdk.