Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.java.programmer Subject: Re: (Android) Getting My Own Package Version Number Followup-To: comp.lang.java.programmer Date: Fri, 13 May 2011 02:22:53 +1200 Organization: Geek Central Lines: 21 Message-ID: References: NNTP-Posting-Host: 118-92-95-178.dsl.dyn.ihug.co.nz Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: lust.ihug.co.nz 1305210173 9566 118.92.95.178 (12 May 2011 14:22:53 GMT) X-Complaints-To: abuse@ihug.co.nz NNTP-Posting-Date: Thu, 12 May 2011 14:22:53 +0000 (UTC) User-Agent: KNode/4.4.7 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4010 In message , jebblue wrote: > On Wed, 11 May 2011 16:38:35 +1200, Lawrence D'Oliveiro wrote: > >> Is there a simpler way than this? >> >> String VersionName; >> try >> { >> VersionName = >> getPackageManager().getPackageInfo(getPackageName(), >> 0).versionName; >> } >> catch (android.content.pm.PackageManager.NameNotFoundException CantFindMe) >> { >> VersionName = "CANTFINDME"; /*!*/ >> } /*catch*/ > > Yes ... But what is it?