Created
August 31, 2010 15:54
-
-
Save yenliangl/559243 to your computer and use it in GitHub Desktop.
How to check if an application is installed in Android system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If no resource for the given package exists, this package is not installed in the phone | |
try { | |
mGenieResources = getPackageManager().getResourcesForApplication(GENIE_PACKAGE_ID); | |
} catch (PackageManager.NameNotFoundException e) { | |
// no weather info available | |
Log.w(LOG_TAG, "Can't find "+GENIE_PACKAGE_ID+". Weather forecast will not be available."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment