Code example for PackageManager.NameNotFoundException

Methods: getMessage

0
			PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
 
			result = String.format("%s (%s)", info.versionName, info.versionCode);
 
		} catch (NameNotFoundException e) {
			Log.w(AboutActivity.class.toString(), "Unable to get application version: " + e.getMessage());
			result = "Unable to get application version.";
		} 
 
		return result;
	} 
 
}