Code example for Method

Methods: invoke

0
	} 
 
	public static boolean hasSystemFeature(final Context pContext, final String pFeature) {
		try { 
			final Method PackageManager_hasSystemFeatures = PackageManager.class.getMethod("hasSystemFeature", new Class[] { String.class });
			return (PackageManager_hasSystemFeatures == null) ? false : (Boolean) PackageManager_hasSystemFeatures.invoke(pContext.getPackageManager(), pFeature);
		} catch (final Throwable t) {
			return false; 
		} 
	} 
 
	/** 
	 * @param pBuildVersionCode taken from {@link Build.VERSION_CODES}. 
	 */ 
	public static boolean isAndroidVersionOrLower(final int pBuildVersionCode) {
		return Build.VERSION.SDK_INT <= pBuildVersionCode;
	} 
 
	/** 
	 * @param pBuildVersionCode taken from {@link Build.VERSION_CODES}. 
	 */