protected static PackageInfo getPackageInfo ( Context ctx ) { try { return ctx . getPackageManager ( ) . getPackageInfo ( ctx . getPackageName ( ) , 0 ) ; } catch ( PackageManager . NameNotFoundException e ) { Log . e ( TAG , "Error getting package info." , e ) ; return null ; } }
Return the Application s PackageInfo if possible or null .